Asv.IO
Asv.IO separates byte transport, protocol decoding, message processing, and logical devices. An application can use the same connection contracts with different protocols without depending on concrete packet classes or transport implementations.
This section follows the architectural guides for Asv.Modeling: contracts first, then data flow, ownership, and short examples. The current source and tests are authoritative for exact behavior.
Layers
The receive path above describes aggregation. Sending goes from a chosen connection toward its endpoints. A parser recognizes protocol messages; a device factory identifies logical devices from those messages. These are separate responsibilities.
Area | Main contracts | Guide |
|---|---|---|
Construction and decoding |
| |
Transport and aggregation |
| |
Processing and formatting |
| |
Binary representation and outbound encoding |
| |
Structured field access |
| |
Device identity and lifecycle |
|
A Hardware-Free Exchange
The example protocol is included in the package and can be used with a virtual connection. This exchange does not open network or serial ports.
A virtual connection has client and server sides. It serializes and parses messages between those sides, so it is useful for checking more than a direct object callback. Transport-specific behavior, reconnects, and queueing still require separate validation.
Boundaries To Keep Explicit
An endpoint identifies a transport connection. It does not necessarily identify one logical device.
A message name or message ID identifies a message kind, not its sender.
IProtocolMessageguarantees serialization and basic identity; it does not requireIVisitableor a device identifier.A connection's TX event is local to that connection level. Router TX and endpoint TX do not describe the same stage.
IDeviceExplorerdiscovers and manages devices through registered factories. ItsTryIdentifymethod attributes a message source to a currently discovered device using optional factory addresses; lookup returns false before discovery and does not create devices or refresh liveness.IDeviceExplorer.TryGetSourceAddressandTryGetDeviceAddressextract canonical addresses without requiring discovery. They use factory order, remain available after disposal, and do not change device state or liveness.
Source Map
The main implementation areas are src/Asv.IO/Protocol, src/Asv.IO/Serializable, src/Asv.IO/Visitable, and src/Asv.IO/Devices. Executable examples live in src/Asv.IO/Example; matching tests are under src/Asv.IO.Test.