moonbit-canbus

A deterministic, dependency-free CAN 2.0 and CAN-FD toolkit for MoonBit.

can
can-fd
dbc
isotp
j1939
vehicle-network
moon add myc1234567/moonbit-canbus@0.1.1
Download zip
Version
0.1.1
License
Apache-2.0
Last updated
8 hours ago
Downloads
5
README

#MoonBit CAN Bus

一个纯 MoonBit、无原生依赖的 CAN 2.0 / CAN-FD 协议与仿真工具包,面向汽车电子、机器人、工业控制和协议测试场景。项目把帧语义、线级编解码、传输层、诊断、DBC 信号、网关和确定性仿真组合成可独立复用的 API。

#项目定位

本项目解决的是“没有硬件也能可靠验证控制器网络逻辑”的问题:同一套数据模型可以用于协议单元测试、DBC 信号解码、虚拟 ECU 联调、日志分析和网关规则验证。它不直接驱动 CAN 控制器,也不替代操作系统的 SocketCAN 或商业硬件 SDK。

#核心能力

  • 标准 11-bit、扩展 29-bit、数据帧、远程帧、错误帧和 CAN-FD 帧模型。
  • CAN-FD DLC 映射、CRC-15/17/21、位填充与去填充、完整 wire 编解码和稳定二进制帧格式。
  • 优先级仲裁、掩码/精确过滤器、确定性虚拟总线、节点注册、发送队列和多节点网络模型。
  • ISO-TP 分段与重组、J1939 标识符与 BAM、CANopen COB-ID/SDO/PDO,以及 UDS 请求、会话、DTC 编解码。
  • DBC BO_ / SG_ 解析、运行时信号编解码、规范化序列化、结构校验和 schema diff。
  • 路由网关、调度器、帧批处理、日志/trace、总线指标、延迟窗口和帧准入策略。

#快速开始

需要已安装 MoonBit stable 工具链。

moon check --target all --deny-warn moon test --target all --deny-warn

在 MoonBit 中创建并检查一帧:

let frame = @moonbit_canbus.data_frame(0x120, [0x2A]) catch {
_ => panic()
}
let wire = @moonbit_canbus.encode_frame(frame)
let restored = @moonbit_canbus.decode_frame(wire) catch {
_ => panic()
}
assert_true(@moonbit_canbus.frame_equal(frame, restored))

#CLI

CLI 位于 src/cmd/canctl,用于快速查看帧编码和指标:

moon run src/cmd/canctl -- demo moon run src/cmd/canctl -- decode 01000000012303102030

基准程序位于 src/cmd/bench,执行 100,000 次稳定帧编码/解码并输出耗时、吞吐、字节数和校验值:

moon run src/cmd/bench

#架构

层次主要模块责任
Frame / wireframe.mbt, frame_codec.mbt, wire.mbt, wire_codec.mbt帧不变量、DLC、CRC、bit stuffing 和可移植编码
Transporttransport.mbt, isotp_engine.mbt, isotp_session.mbt, j1939_transport.mbt, transport_queue.mbtISO-TP、J1939、队列、时序与边界处理
Databasedbc.mbt, dbc_extended.mbt, dbc_runtime.mbt, dbc_workspace.mbt, dbc_codegen.mbt, dbc_serializer.mbtDBC 解析、信号运行时、schema 工具和代码生成
Diagnosticsdiagnostic.mbt, uds_stack.mbt, diagnostic_session.mbt, diagnostic_catalog.mbt, diagnostic_workflow.mbt, diagnostic_codec.mbt, ecu_simulator.mbtUDS 服务、会话状态、DTC、ECU 仿真和诊断工作流
Networkfilter.mbt, can_network.mbt, hardware_adapter.mbt, canopen_device.mbt, routing.mbt, gateway_policy_advanced.mbt, simulation.mbt, simulation_profile.mbt过滤、适配器抽象、CANopen、网关、多节点网络和确定性仿真
Analysistrace.mbt, trace_query.mbt, trace_export.mbt, bus_analysis_advanced.mbt, network_health_advanced.mbt, compatibility_matrix.mbt, metrics.mbt, latency.mbt日志查询、导出、总线利用率、网络健康和部署兼容性分析

模块之间通过 FrameFilterTrace 等小型值对象连接,避免把硬件 I/O、时钟和协议状态耦合到核心算法中。

#基准

基准程序使用本地 MoonBit WASM-GC 后端和固定的 8-byte Classic CAN 数据帧,实际运行记录见 BENCHMARKS.md。基准输出包含可复核的迭代次数、墙钟耗时、吞吐和 checksum;不同机器和后端的绝对数值会变化,因此仓库不把单次机器结果当作性能承诺。

#测试与边界覆盖

测试覆盖 Classic CAN、CAN-FD、29-bit ID、64-byte payload、DLC 边界、CRC/bit stuffing、ISO-TP 长消息、UDS 负响应、DTC、DBC 非法布局、队列满/空、时间逆序、节点离线、速率限制、trace 和延迟百分位等路径。

本地质量门禁:

moon fmt moon check --target all --deny-warn moon test --target all --deny-warn moon info

#CI

.github/workflows/check.yml 在 Linux、macOS 和 Windows 上安装 MoonBit stable,显式配置 Node.js 运行时,执行格式检查、moon info、全后端 check/build/test,并验证生产 MoonBit 源码规模门槛。工作流使用官方安装脚本,便于工具链持续跟随 stable。

#许可证

本项目采用 Apache License 2.0

#
AdmissionError

pub suberror AdmissionError {
InvalidRule
NoMatchingRule
ProtocolNotAllowed
PayloadTooLarge
RemoteNotAllowed
RateExceeded
TimestampReversed
} derive(
Debug
)

Errors raised by a frame admission policy.

#
BatchError

pub suberror BatchError {
EmptyBatch
BatchTooLarge
InvalidRecord
ChecksumMismatch
} derive(
Debug
)

Errors raised by batch processing and binary archive helpers.

#
BitError

pub suberror BitError {
InvalidWidth
InvalidValue
OutOfBounds
} derive(
Debug
)

Errors raised by the bit-level reader and writer.

#
CanAdapterError

pub suberror CanAdapterError {
CanAdapterNotOpen
CanAdapterAlreadyOpen
CanAdapterBusOffError
CanAdapterQueueFull
CanAdapterUnsupported
CanAdapterInvalidConfiguration
CanAdapterRejectedFrame
}

Errors returned by the backend-neutral adapter façade.

#
CanOpenError

pub suberror CanOpenError {
InvalidNodeId
InvalidCobId
InvalidIndex
InvalidSdoPayload
InvalidDataLength
} derive(
Debug
)

Errors raised by CANopen identifier and SDO helpers.

#
CanTextError

pub suberror CanTextError {
InvalidHeader
InvalidFieldCount
InvalidTimestamp
InvalidPayload
} derive(
Debug
)

Errors raised by text log parsing.

#
CanTimingError

pub suberror CanTimingError {
InvalidClock
InvalidBitrate
InvalidSamplePoint
NoTimingCandidate
} derive(
Debug
)

Errors raised by CAN bit-timing calculations.

#
DbcError

pub suberror DbcError {
InvalidMessageLine(String)
InvalidSignalLine(String)
InvalidNumber(String)
}

A small, dependency-free DBC reader for message and signal definitions.

#
DbcExtendedError

pub suberror DbcExtendedError {
InvalidMessage
InvalidSignal
InvalidNumber
MissingMessage
InvalidRange
} derive(
Debug
)

Errors from the extended DBC reader.

#
DbcRuntimeError

pub suberror DbcRuntimeError {
InvalidSignalLayout
PayloadTooShort
PayloadTooLong
DuplicateSignal
MissingSignalValue
ValueOutOfRange
} derive(
Debug
)

Errors raised by checked DBC runtime operations.

#
DbcSchemaError

pub suberror DbcSchemaError {
DuplicateMessageId
InvalidIdentifier
EmptyMessageName
InvalidDlc
InvalidSignalLayout
OverlappingSignals
} derive(
Debug
)

Errors raised when validating or serializing a DBC schema.

#
DtcCodecError

pub suberror DtcCodecError {
InvalidCode
InvalidPayload
InvalidRecordLength
CapacityExceeded
} derive(
Debug
)

Errors raised while encoding or decoding diagnostic trouble codes.

#
EcuMemoryError

pub suberror EcuMemoryError {
EcuMemoryOutOfRange
EcuMemoryPermissionDenied
EcuMemoryInvalidLength
EcuMemoryOverlappingRegion
}

#
FrameCodecError

pub suberror FrameCodecError {
UnsupportedVersion
Truncated
InvalidFlags
InvalidPayloadLength
InvalidHex
} derive(
Debug
)

Errors raised by the portable frame codec.

#
FrameError

pub suberror FrameError {
InvalidIdentifier
InvalidLength
} derive(
Debug
)

A frame validation error.

#
FramePipelineError

pub suberror FramePipelineError {
FramePipelineInvalidPayload
FramePipelineRuleExists
FramePipelineRuleMissing
FramePipelineCapacity
}

#
GatewayPolicyError

pub suberror GatewayPolicyError {
GatewayPolicyInvalidPayload
GatewayPolicyDuplicateRule
GatewayPolicyRuleNotFound
GatewayPolicyInvalidInterval
}

#
IsoTpError

pub suberror IsoTpError {
InvalidFrameSize
PayloadTooLarge
TruncatedPacket
InvalidFirstFrame
UnexpectedConsecutive
SequenceMismatch
LengthMismatch
UnsupportedFlowStatus
} derive(
Debug
)

Errors raised by checked ISO-TP operations.

#
J1939Error

pub suberror J1939Error {
InvalidPriority
InvalidPgn
InvalidAddress
InvalidPayloadLength
InvalidSequence
TransferTooLarge
} derive(
Debug
)

Errors raised by J1939 identifier and transport helpers.

#
LatencyError

pub suberror LatencyError {
InvalidCapacity
InvalidTimestamp
InvalidPercentile
} derive(
Debug
)

Errors raised by a latency measurement window.

#
NetworkError

pub suberror NetworkError {
InvalidNodeId
DuplicateNode
UnknownNode
InvalidTimestamp
QueueFull
} derive(
Debug
)

Errors raised by the deterministic multi-node network model.

#
NodeRegistryError

pub suberror NodeRegistryError {
InvalidNodeId
DuplicateNode
UnknownNode
} derive(
Debug
)

Errors raised by node registry operations.

#
PayloadError

pub suberror PayloadError {
InvalidOffset
InvalidWidth
InvalidCounter
InvalidFrame
} derive(
Debug
)

Payload transformation errors.

#
PdoError

pub suberror PdoError {
InvalidMapping
TooManyEntries
ValueTooLarge
PayloadOverflow
} derive(
Debug
)

CANopen PDO mapping errors.

#
QueueError

pub suberror QueueError {
InvalidCapacity
InvalidLimit
Full
Empty
UnknownSequence
} derive(
Debug
)

Errors raised by the bounded transmit queue.

#
RoutingError

pub suberror RoutingError {
InvalidOutputIdentifier
InvalidPrefix
PayloadOverflow
} derive(
Debug
)

Errors raised when a gateway transforms a frame.

#
SchedulerError

pub suberror SchedulerError {
InvalidPeriod
InvalidDeadline
DuplicateTask
UnknownTask
} derive(
Debug
)

Errors raised by the deterministic message scheduler.

#
SimulationError

pub suberror SimulationError {
TimeWentBackwards
InvalidPeriod
EventLimitReached
} derive(
Debug
)

Errors raised by deterministic network simulation.

#
TraceError

pub suberror TraceError {
NonMonotonicTimestamp
InvalidLine
InvalidTimestamp
InvalidFrame
} derive(
Debug
)

Errors raised when validating or parsing a trace log.

#
UdsError

pub suberror UdsError {
InvalidIdentifier
InvalidAddressFormat
EmptyPayload
InvalidBlockCounter
InvalidLength
} derive(
Debug
)

Additional errors for building and validating UDS exchanges.

#
UdsSessionError

pub suberror UdsSessionError {
InvalidTransition
SecurityRequired
ResponseTimeout
UnexpectedResponse
} derive(
Debug
)

Errors raised by the session state machine.

#
WireCodecError

pub suberror WireCodecError {
InvalidEof
InvalidCrc
InvalidControl
InvalidDlc
InvalidFrameBits
} derive(
Debug
)

Errors raised by the complete bit-level wire codec.

#
WireError

pub suberror WireError {
InvalidStuffedBit
}

Errors produced when removing CAN bit stuffing.

#
AdmissionDecision

pub struct AdmissionDecision {
accepted : Bool
rule_name : String
reason : String
}

The result of an admission check.

#
AdmissionDecision::accepted

fn AdmissionDecision::accepted(self : AdmissionDecision) -> Bool

#
AdmissionDecision::reason

fn AdmissionDecision::reason(self : AdmissionDecision) -> String

#
AdmissionDecision::rule_name

fn AdmissionDecision::rule_name(self : AdmissionDecision) -> String

#
AdmissionPolicy

pub struct AdmissionPolicy {
rules : Array[AdmissionRule]
accepted_count : Int
rejected_count : Int
last_timestamp_us : UInt64?
}

A first-match frame admission policy with counters and timing guards.

#
AdmissionPolicy::accepted

fn AdmissionPolicy::accepted(self : AdmissionPolicy) -> Int

#
AdmissionPolicy::add_rule

fn AdmissionPolicy::add_rule(self : AdmissionPolicy, rule : AdmissionRule) -> Unit

#
AdmissionPolicy::admit

fn AdmissionPolicy::admit(self : AdmissionPolicy, frame : Frame, timestamp_us : UInt64) -> Bool

Return whether a frame is admitted, preserving the policy counters.

#
AdmissionPolicy::evaluate

fn AdmissionPolicy::evaluate(self : AdmissionPolicy, frame : Frame, timestamp_us : UInt64) -> AdmissionDecision raise AdmissionError

Evaluate the first matching rule and update its rate window on success.

#
AdmissionPolicy::rejected

fn AdmissionPolicy::rejected(self : AdmissionPolicy) -> Int

#
AdmissionPolicy::reset

fn AdmissionPolicy::reset(self : AdmissionPolicy) -> Unit

Reset all per-rule timing windows and counters.

#
AdmissionPolicy::rule_count

fn AdmissionPolicy::rule_count(self : AdmissionPolicy) -> Int

#
AdmissionRule

pub struct AdmissionRule {
name : String
filter : Filter
max_payload : Int
allow_fd : Bool
allow_remote : Bool
min_interval_us : UInt64
last_seen_us : UInt64?
}

A named rule for a group of accepted frames.

#
AdmissionRule::allows_fd

fn AdmissionRule::allows_fd(self : AdmissionRule) -> Bool

#
AdmissionRule::allows_remote

fn AdmissionRule::allows_remote(self : AdmissionRule) -> Bool

#
AdmissionRule::max_payload

fn AdmissionRule::max_payload(self : AdmissionRule) -> Int

#
AdmissionRule::minimum_interval

fn AdmissionRule::minimum_interval(self : AdmissionRule) -> UInt64

#
AdmissionRule::name

fn AdmissionRule::name(self : AdmissionRule) -> String

#
BitReader

pub struct BitReader {
bits : Array[Bool]
position : Int
}

A sequential most-significant-bit-first reader.

#
BitReader::peek

fn BitReader::peek(self : BitReader, width : Int) -> UInt raise BitError

Inspect a bit without advancing the reader.

#
BitReader::position

fn BitReader::position(self : BitReader) -> Int

Return the current read offset.

#
BitReader::read

fn BitReader::read(self : BitReader, width : Int) -> UInt raise BitError

Read an unsigned value of exactly width bits.

#
BitReader::read_bit

fn BitReader::read_bit(self : BitReader) -> Bool raise BitError

Read one bit.

#
BitReader::read_signed

fn BitReader::read_signed(self : BitReader, width : Int) -> Int raise BitError

Read a signed two's-complement value of up to 31 bits.

#
BitReader::remaining

fn BitReader::remaining(self : BitReader) -> Int

Return the number of unread bits.

#
BitReader::skip

fn BitReader::skip(self : BitReader, width : Int) -> Unit raise BitError

Skip a number of bits.

#
BitWriter

pub struct BitWriter {
bits : Array[Bool]
}

A growable most-significant-bit-first writer.

#
BitWriter::align_byte

fn BitWriter::align_byte(self : BitWriter) -> Unit

Add zero padding until the writer reaches a byte boundary.

#
BitWriter::finish

fn BitWriter::finish(self : BitWriter) -> Array[Bool]

Return a defensive copy of the written bits.

#
BitWriter::length

fn BitWriter::length(self : BitWriter) -> Int

Return the number of bits currently written.

#
BitWriter::to_bytes

fn BitWriter::to_bytes(self : BitWriter) -> Array[Byte]

Return the written bits packed into bytes, padding the final byte with 0.

#
BitWriter::write

fn BitWriter::write(self : BitWriter, value : UInt, width : Int) -> Unit raise BitError

Append an unsigned value using exactly width high-to-low bits.

#
BitWriter::write_bit

fn BitWriter::write_bit(self : BitWriter, bit : Bool) -> Unit

Append one bit.

#
BitWriter::write_signed

fn BitWriter::write_signed(self : BitWriter, value : Int, width : Int) -> Unit raise BitError

Append a signed two's-complement value.

#
BusAnalysisAnomaly

pub enum BusAnalysisAnomaly {
BusAnomalyBurst(UInt, Int)
BusAnomalyJitter(UInt, UInt64)
BusAnomalyPayloadGrowth(UInt, Int, Int)
BusAnomalyIdentifierChange(UInt)
BusAnomalyTimestampRegression(UInt64)
BusAnomalySequenceGap(UInt, UInt)
BusAnomalyOverload(Double)
}

A compliance or quality anomaly detected from observations.

#
BusAnalysisMode

pub enum BusAnalysisMode {
BusAnalysisLive
BusAnalysisOffline
BusAnalysisReplay
BusAnalysisCompliance
}

Analysis mode used by a bus observability pipeline.

#
BusAnalysisReport

pub struct BusAnalysisReport {
mode : BusAnalysisMode
channel : String
start_us : UInt64?
end_us : UInt64?
total_frames : Int
payload_bytes : Int
wire_bits : Int
profiles : Array[BusIdentifierProfile]
anomalies : Array[BusAnalysisAnomaly]
utilization : Double
}

A completed report from a bus analyzer.

#
BusAnalysisReport::anomalies

#
BusAnalysisReport::channel

fn BusAnalysisReport::channel(self : BusAnalysisReport) -> String

#
BusAnalysisReport::end_us

fn BusAnalysisReport::end_us(self : BusAnalysisReport) -> UInt64?

#
BusAnalysisReport::healthy

fn BusAnalysisReport::healthy(self : BusAnalysisReport) -> Bool

#
BusAnalysisReport::mode

#
BusAnalysisReport::payload_bytes

fn BusAnalysisReport::payload_bytes(self : BusAnalysisReport) -> Int

#
BusAnalysisReport::profiles

#
BusAnalysisReport::start_us

fn BusAnalysisReport::start_us(self : BusAnalysisReport) -> UInt64?

#
BusAnalysisReport::to_text

fn BusAnalysisReport::to_text(self : BusAnalysisReport) -> String

#
BusAnalysisReport::total_frames

fn BusAnalysisReport::total_frames(self : BusAnalysisReport) -> Int

#
BusAnalysisReport::utilization

fn BusAnalysisReport::utilization(self : BusAnalysisReport) -> Double

#
BusAnalysisReport::wire_bits

fn BusAnalysisReport::wire_bits(self : BusAnalysisReport) -> Int

#
BusAnalyzer

pub struct BusAnalyzer {
mode : BusAnalysisMode
channel : String
bitrate_kbps : UInt
burst_window_us : UInt64
jitter_limit_us : UInt64
observations : Array[BusObservation]
last_timestamp_us : UInt64?
last_sequence : UInt?
}

A stateful analyzer that can be fed by a live adapter or a trace.

#
BusAnalyzer::anomalies

#
BusAnalyzer::bitrate_kbps

fn BusAnalyzer::bitrate_kbps(self : BusAnalyzer) -> UInt

#
BusAnalyzer::channel

fn BusAnalyzer::channel(self : BusAnalyzer) -> String

#
BusAnalyzer::length

fn BusAnalyzer::length(self : BusAnalyzer) -> Int

#
BusAnalyzer::mode

#
BusAnalyzer::observations

fn BusAnalyzer::observations(self : BusAnalyzer) -> Array[BusObservation]

#
BusAnalyzer::observe

fn BusAnalyzer::observe(self : BusAnalyzer, item : BusObservation) -> Unit

#
BusAnalyzer::observe_frame

fn BusAnalyzer::observe_frame(self : BusAnalyzer, timestamp_us : UInt64, frame : Frame) -> Unit

#
BusAnalyzer::profile

fn BusAnalyzer::profile(self : BusAnalyzer, identifier : UInt) -> BusIdentifierProfile?

#
BusAnalyzer::profiles

#
BusAnalyzer::report

#
BusAnalyzer::reset

fn BusAnalyzer::reset(self : BusAnalyzer) -> Unit

#
BusAnalyzer::sorted_observations

fn BusAnalyzer::sorted_observations(self : BusAnalyzer) -> Array[BusObservation]

#
BusHealth

pub struct BusHealth {
state : BusHealthState
utilization : Double
drop_rate : Double
error_rate : Double
recommendations : Array[String]
}

A deterministic health assessment for dashboards and CI.

#
BusHealth::drop_rate

fn BusHealth::drop_rate(self : BusHealth) -> Double

#
BusHealth::error_rate

fn BusHealth::error_rate(self : BusHealth) -> Double

#
BusHealth::recommendations

fn BusHealth::recommendations(self : BusHealth) -> Array[String]

#
BusHealth::state

fn BusHealth::state(self : BusHealth) -> BusHealthState

#
BusHealth::to_text

fn BusHealth::to_text(self : BusHealth) -> String

#
BusHealth::utilization

fn BusHealth::utilization(self : BusHealth) -> Double

#
BusHealthState

pub enum BusHealthState {
Healthy
Busy
Degraded
Overloaded
Silent
} derive(
Debug
)

Health levels for a monitored CAN channel.

#
BusIdentifierProfile

pub struct BusIdentifierProfile {
identifier : UInt
frames : Int
first_seen_us : UInt64
last_seen_us : UInt64
min_payload : Int
max_payload : Int
wire_bits : Int
extended : Bool
intervals : Array[UInt64]
}

Per-identifier statistics accumulated by a bus analyzer.

#
BusIdentifierProfile::average_interval_us

fn BusIdentifierProfile::average_interval_us(self : BusIdentifierProfile) -> UInt64

#
BusIdentifierProfile::extended

fn BusIdentifierProfile::extended(self : BusIdentifierProfile) -> Bool

#
BusIdentifierProfile::first_seen_us

fn BusIdentifierProfile::first_seen_us(self : BusIdentifierProfile) -> UInt64

#
BusIdentifierProfile::frames

fn BusIdentifierProfile::frames(self : BusIdentifierProfile) -> Int

#
BusIdentifierProfile::frequency_hz

fn BusIdentifierProfile::frequency_hz(self : BusIdentifierProfile) -> Double

#
BusIdentifierProfile::identifier

fn BusIdentifierProfile::identifier(self : BusIdentifierProfile) -> UInt

#
BusIdentifierProfile::intervals

fn BusIdentifierProfile::intervals(self : BusIdentifierProfile) -> Array[UInt64]

#
BusIdentifierProfile::jitter_us

fn BusIdentifierProfile::jitter_us(self : BusIdentifierProfile) -> UInt64

#
BusIdentifierProfile::last_seen_us

fn BusIdentifierProfile::last_seen_us(self : BusIdentifierProfile) -> UInt64

#
BusIdentifierProfile::max_payload

fn BusIdentifierProfile::max_payload(self : BusIdentifierProfile) -> Int

#
BusIdentifierProfile::min_payload

fn BusIdentifierProfile::min_payload(self : BusIdentifierProfile) -> Int

#
BusIdentifierProfile::wire_bits

fn BusIdentifierProfile::wire_bits(self : BusIdentifierProfile) -> Int

#
BusObservation

pub struct BusObservation {
timestamp_us : UInt64
frame : Frame
channel : String
sequence : UInt
}

One timestamped observation supplied to the analyzer.

#
BusObservation::channel

fn BusObservation::channel(self : BusObservation) -> String

#
BusObservation::frame

fn BusObservation::frame(self : BusObservation) -> Frame

#
BusObservation::sequence

fn BusObservation::sequence(self : BusObservation) -> UInt

#
BusObservation::timestamp_us

fn BusObservation::timestamp_us(self : BusObservation) -> UInt64

#
ByteOrder

pub(all) enum ByteOrder {
BigEndian
LittleEndian
}

Byte ordering used by application payload adapters.

#
CanAdapterCapabilities

pub struct CanAdapterCapabilities {
classic : Bool
can_fd : Bool
bitrate_switch : Bool
listen_only : Bool
loopback : Bool
timestamping : Bool
max_rx_queue : Int
max_tx_queue : Int
}

Capabilities exposed by a hardware or virtual CAN backend.

#
CanAdapterCapabilities::bitrate_switch

fn CanAdapterCapabilities::bitrate_switch(self : CanAdapterCapabilities) -> Bool

#
CanAdapterCapabilities::can_fd

#
CanAdapterCapabilities::classic

#
CanAdapterCapabilities::listen_only

fn CanAdapterCapabilities::listen_only(self : CanAdapterCapabilities) -> Bool

#
CanAdapterCapabilities::loopback

fn CanAdapterCapabilities::loopback(self : CanAdapterCapabilities) -> Bool

#
CanAdapterCapabilities::max_rx_queue

fn CanAdapterCapabilities::max_rx_queue(self : CanAdapterCapabilities) -> Int

#
CanAdapterCapabilities::max_tx_queue

fn CanAdapterCapabilities::max_tx_queue(self : CanAdapterCapabilities) -> Int

#
CanAdapterCapabilities::timestamping

fn CanAdapterCapabilities::timestamping(self : CanAdapterCapabilities) -> Bool

#
CanAdapterConfig

pub struct CanAdapterConfig {
nominal_bitrate_kbps : UInt
data_bitrate_kbps : UInt
listen_only : Bool
loopback : Bool
receive_own : Bool
filter : Filter?
}

Configuration requested from an adapter before opening it.

#
CanAdapterConfig::data_bitrate_kbps

fn CanAdapterConfig::data_bitrate_kbps(self : CanAdapterConfig) -> UInt

#
CanAdapterConfig::filter

#
CanAdapterConfig::listen_only

fn CanAdapterConfig::listen_only(self : CanAdapterConfig) -> Bool

#
CanAdapterConfig::loopback

fn CanAdapterConfig::loopback(self : CanAdapterConfig) -> Bool

#
CanAdapterConfig::nominal_bitrate_kbps

fn CanAdapterConfig::nominal_bitrate_kbps(self : CanAdapterConfig) -> UInt

#
CanAdapterConfig::receive_own

fn CanAdapterConfig::receive_own(self : CanAdapterConfig) -> Bool

#
CanAdapterHub

pub struct CanAdapterHub {
ports : Array[CanPort]
routed : Int
missed : Int
}

A collection of adapter ports used by a test harness.

#
CanAdapterHub::add

fn CanAdapterHub::add(self : CanAdapterHub, port : CanPort) -> Bool

#
CanAdapterHub::broadcast

fn CanAdapterHub::broadcast(self : CanAdapterHub, source : String, timestamp_us : UInt64, frame : Frame) -> Int

#
CanAdapterHub::find

fn CanAdapterHub::find(self : CanAdapterHub, name : String) -> CanPort?

#
CanAdapterHub::missed

fn CanAdapterHub::missed(self : CanAdapterHub) -> Int

#
CanAdapterHub::ports

#
CanAdapterHub::routed

fn CanAdapterHub::routed(self : CanAdapterHub) -> Int

#
CanAdapterHub::to_text

fn CanAdapterHub::to_text(self : CanAdapterHub) -> String

#
CanAdapterLifecycle

pub enum CanAdapterLifecycle {
CanAdapterCreated
CanAdapterConfigured
CanAdapterOpen
CanAdapterBusOff
CanAdapterClosed
}

Lifecycle state of a portable CAN adapter.

#
CanAdapterMessage

pub struct CanAdapterMessage {
timestamp_us : UInt64
frame : Frame
direction_tx : Bool
sequence : UInt
}

A timestamped frame delivered by an adapter.

#
CanAdapterMessage::direction_text

fn CanAdapterMessage::direction_text(self : CanAdapterMessage) -> String

#
CanAdapterMessage::direction_tx

fn CanAdapterMessage::direction_tx(self : CanAdapterMessage) -> Bool

#
CanAdapterMessage::frame

#
CanAdapterMessage::sequence

fn CanAdapterMessage::sequence(self : CanAdapterMessage) -> UInt

#
CanAdapterMessage::timestamp_us

fn CanAdapterMessage::timestamp_us(self : CanAdapterMessage) -> UInt64

#
CanAdapterStats

pub struct CanAdapterStats {
transmitted : Int
received : Int
dropped_rx : Int
rejected_tx : Int
bus_off : Int
error_frames : Int
bytes_tx : Int
bytes_rx : Int
}

Counters maintained by a CAN adapter.

#
CanAdapterStats::bus_off

fn CanAdapterStats::bus_off(self : CanAdapterStats) -> Int

#
CanAdapterStats::bytes_rx

fn CanAdapterStats::bytes_rx(self : CanAdapterStats) -> Int

#
CanAdapterStats::bytes_tx

fn CanAdapterStats::bytes_tx(self : CanAdapterStats) -> Int

#
CanAdapterStats::dropped_rx

fn CanAdapterStats::dropped_rx(self : CanAdapterStats) -> Int

#
CanAdapterStats::error_frames

fn CanAdapterStats::error_frames(self : CanAdapterStats) -> Int

#
CanAdapterStats::received

fn CanAdapterStats::received(self : CanAdapterStats) -> Int

#
CanAdapterStats::rejected_tx

fn CanAdapterStats::rejected_tx(self : CanAdapterStats) -> Int

#
CanAdapterStats::to_text

fn CanAdapterStats::to_text(self : CanAdapterStats) -> String

#
CanAdapterStats::total

fn CanAdapterStats::total(self : CanAdapterStats) -> Int

#
CanAdapterStats::transmitted

fn CanAdapterStats::transmitted(self : CanAdapterStats) -> Int

#
CanBitTiming

pub struct CanBitTiming {
clock_hz : UInt
bitrate : UInt
prescaler : UInt
time_quanta : UInt
propagation_segment : UInt
phase_segment_1 : UInt
phase_segment_2 : UInt
sample_point_percent : Double
}

A nominal or data-phase bit-timing candidate.

#
CanBitTiming::actual_bitrate

fn CanBitTiming::actual_bitrate(self : CanBitTiming) -> UInt

Return the actual bitrate represented by a timing configuration.

#
CanBitTiming::bit_time_ns

fn CanBitTiming::bit_time_ns(self : CanBitTiming) -> UInt64

#
CanBitTiming::bitrate

fn CanBitTiming::bitrate(self : CanBitTiming) -> UInt

#
CanBitTiming::clock_hz

fn CanBitTiming::clock_hz(self : CanBitTiming) -> UInt

#
CanBitTiming::prescaler

fn CanBitTiming::prescaler(self : CanBitTiming) -> UInt

#
CanBitTiming::sample_point

fn CanBitTiming::sample_point(self : CanBitTiming) -> Double

#
CanBitTiming::time_quanta

fn CanBitTiming::time_quanta(self : CanBitTiming) -> UInt

#
CanFdTiming

pub struct CanFdTiming {
nominal : CanBitTiming
data : CanBitTiming
}

CAN-FD timing for nominal and data phases.

#
CanFdTiming::data

#
CanFdTiming::nominal

fn CanFdTiming::nominal(self : CanFdTiming) -> CanBitTiming

#
CanGateway

pub struct CanGateway {
routes : Array[RouteRule]
forwarded : Int
rejected : Int
}

A stateless rule-based CAN gateway.

#
CanGateway::add_rule

fn CanGateway::add_rule(self : CanGateway, rule : RouteRule) -> Unit

#
CanGateway::forward

fn CanGateway::forward(self : CanGateway, input : Frame) -> RoutedFrame? raise RoutingError

Apply the first matching rule.

#
CanGateway::forwarded

fn CanGateway::forwarded(self : CanGateway) -> Int

#
CanGateway::rejected

fn CanGateway::rejected(self : CanGateway) -> Int

#
CanGateway::rule_count

fn CanGateway::rule_count(self : CanGateway) -> Int

#
CanGateway::rule_names

fn CanGateway::rule_names(self : CanGateway) -> Array[String]

Return route names in insertion order.

#
CanLog

pub struct CanLog {
entries : Array[CanLogEntry]
}

A portable text log with stable ordering.

#
CanLog::entries

fn CanLog::entries(self : CanLog) -> Array[CanLogEntry]

#
CanLog::filter_channel

fn CanLog::filter_channel(self : CanLog, channel : String) -> CanLog

#
CanLog::length

fn CanLog::length(self : CanLog) -> Int

#
CanLog::push

fn CanLog::push(self : CanLog, timestamp_us : UInt64, frame : Frame, channel? : String) -> Unit

#
CanLog::sorted

fn CanLog::sorted(self : CanLog) -> CanLog

#
CanLog::to_text

fn CanLog::to_text(self : CanLog) -> String

Encode a log with a header and one comma-separated record per line.

#
CanLogEntry

pub struct CanLogEntry {
timestamp_us : UInt64
frame : Frame
channel : String
}

A human-readable CAN log record.

#
CanLogEntry::channel

fn CanLogEntry::channel(self : CanLogEntry) -> String

#
CanLogEntry::frame

fn CanLogEntry::frame(self : CanLogEntry) -> Frame

#
CanLogEntry::timestamp

fn CanLogEntry::timestamp(self : CanLogEntry) -> UInt64

#
CanNetwork

pub struct CanNetwork {
timeout_us : UInt64
now_us : UInt64
nodes : Array[NetworkNode]
queue : FrameQueue
delivered : Int
}

A deterministic CAN network with bounded transmit buffering and liveness.

#
CanNetwork::add_node

fn CanNetwork::add_node(self : CanNetwork, node_id : Byte, name : String, timestamp_us : UInt64) -> Unit raise NetworkError

Register a node at a known timestamp.

#
CanNetwork::delivered

fn CanNetwork::delivered(self : CanNetwork) -> Int

#
CanNetwork::heartbeat

fn CanNetwork::heartbeat(self : CanNetwork, node_id : Byte, timestamp_us : UInt64) -> Unit raise NetworkError

Record a heartbeat and bring a node online.

#
CanNetwork::node

fn CanNetwork::node(self : CanNetwork, node_id : Byte) -> NetworkNode?

#
CanNetwork::node_count

fn CanNetwork::node_count(self : CanNetwork) -> Int

#
CanNetwork::now

fn CanNetwork::now(self : CanNetwork) -> UInt64

#
CanNetwork::offline_nodes

fn CanNetwork::offline_nodes(self : CanNetwork, timestamp_us : UInt64) -> Array[String] raise NetworkError

Mark nodes stale at a timestamp and return their stable names.

#
CanNetwork::pending

fn CanNetwork::pending(self : CanNetwork) -> Int

#
CanNetwork::poll

fn CanNetwork::poll(self : CanNetwork, timestamp_us : UInt64) -> Array[NetworkDelivery] raise NetworkError

Deliver every frame queued by timestamp_us in arbitration order.

#
CanNetwork::send

fn CanNetwork::send(self : CanNetwork, sender : Byte, frame : Frame, timestamp_us : UInt64) -> UInt raise NetworkError

Queue a frame from a registered sender.

#
CanNode

pub struct CanNode {
node_id : Byte
name : String
filter : Filter
received : Int
transmitted : Int
}

A monitored node and its receive filter.

#
CanNode::name

fn CanNode::name(self : CanNode) -> String

#
CanNode::node_id

fn CanNode::node_id(self : CanNode) -> Byte

#
CanNode::received

fn CanNode::received(self : CanNode) -> Int

#
CanNode::transmitted

fn CanNode::transmitted(self : CanNode) -> Int

#
CanOpenCobId

pub struct CanOpenCobId {
object_type : CanOpenCobType
node_id : Byte
identifier : UInt
}

A decoded CANopen communication object identifier.

#
CanOpenCobId::identifier

fn CanOpenCobId::identifier(self : CanOpenCobId) -> UInt

#
CanOpenCobId::node_id

fn CanOpenCobId::node_id(self : CanOpenCobId) -> Byte

#
CanOpenCobId::object_type

fn CanOpenCobId::object_type(self : CanOpenCobId) -> CanOpenCobType

#
CanOpenCobType

pub(all) enum CanOpenCobType {
Nmt
Sync
Emergency
Pdo1Transmit
Pdo1Receive
Pdo2Transmit
Pdo2Receive
Pdo3Transmit
Pdo3Receive
Pdo4Transmit
Pdo4Receive
SdoTransmit
SdoReceive
Heartbeat
} derive(
Debug
)

CANopen communication object types.

#
CanOpenDevice

pub struct CanOpenDevice {
node_id : Byte
name : String
state : CanOpenDeviceState
dictionary : CanOpenObjectDictionary
heartbeat : CanOpenHeartbeatMonitor
nmt_commands : Int
sdo_uploads : Int
sdo_downloads : Int
}

A CANopen device model with NMT, SDO and heartbeat support.

#
CanOpenDevice::add_object

fn CanOpenDevice::add_object(self : CanOpenDevice, entry : CanOpenObjectEntry) -> Bool

#
CanOpenDevice::dictionary

#
CanOpenDevice::heartbeat

#
CanOpenDevice::heartbeat_receive

fn CanOpenDevice::heartbeat_receive(self : CanOpenDevice, state_byte : Byte, timestamp_us : UInt64) -> Unit

#
CanOpenDevice::heartbeat_tick

fn CanOpenDevice::heartbeat_tick(self : CanOpenDevice, timestamp_us : UInt64) -> CanOpenHeartbeatState

#
CanOpenDevice::name

fn CanOpenDevice::name(self : CanOpenDevice) -> String

#
CanOpenDevice::nmt

#
CanOpenDevice::nmt_commands

fn CanOpenDevice::nmt_commands(self : CanOpenDevice) -> Int

#
CanOpenDevice::node_id

fn CanOpenDevice::node_id(self : CanOpenDevice) -> Byte

#
CanOpenDevice::sdo_download

fn CanOpenDevice::sdo_download(self : CanOpenDevice, index : UInt, sub_index : Byte, data : Array[Byte]) -> CanOpenDeviceSdoResult

#
CanOpenDevice::sdo_downloads

fn CanOpenDevice::sdo_downloads(self : CanOpenDevice) -> Int

#
CanOpenDevice::sdo_upload

fn CanOpenDevice::sdo_upload(self : CanOpenDevice, index : UInt, sub_index : Byte) -> CanOpenDeviceSdoResult

#
CanOpenDevice::sdo_uploads

fn CanOpenDevice::sdo_uploads(self : CanOpenDevice) -> Int

#
CanOpenDevice::state

#
CanOpenDevice::to_text

fn CanOpenDevice::to_text(self : CanOpenDevice) -> String

#
CanOpenDeviceNetwork

pub struct CanOpenDeviceNetwork {
devices : Array[CanOpenDevice]
commands : Int
unknown_nodes : Int
}

A deterministic collection of CANopen devices.

#
CanOpenDeviceNetwork::add

fn CanOpenDeviceNetwork::add(self : CanOpenDeviceNetwork, device : CanOpenDevice) -> Bool

#
CanOpenDeviceNetwork::broadcast_nmt

fn CanOpenDeviceNetwork::broadcast_nmt(self : CanOpenDeviceNetwork, command : CanOpenNmtCommand) -> Int

#
CanOpenDeviceNetwork::commands

fn CanOpenDeviceNetwork::commands(self : CanOpenDeviceNetwork) -> Int

#
CanOpenDeviceNetwork::devices

#
CanOpenDeviceNetwork::find

fn CanOpenDeviceNetwork::find(self : CanOpenDeviceNetwork, node_id : Byte) -> CanOpenDevice?

#
CanOpenDeviceNetwork::sdo_upload

fn CanOpenDeviceNetwork::sdo_upload(self : CanOpenDeviceNetwork, node_id : Byte, index : UInt, sub_index : Byte) -> CanOpenDeviceSdoResult

#
CanOpenDeviceNetwork::unknown_nodes

fn CanOpenDeviceNetwork::unknown_nodes(self : CanOpenDeviceNetwork) -> Int

#
CanOpenDeviceSdoResult

pub enum CanOpenDeviceSdoResult {
CanOpenDeviceSdoUploaded(Array[Byte])
CanOpenDeviceSdoDownloaded
CanOpenDeviceSdoAbort(UInt)
}

Result of an SDO access handled by a device.

#
CanOpenDeviceSdoSession

pub struct CanOpenDeviceSdoSession {
index : UInt
sub_index : Byte
upload : Bool
data : Array[Byte]
offset : Int
toggle : Bool
block_size : Int
}

Stateful SDO transfer context.

#
CanOpenDeviceSdoSession::complete

#
CanOpenDeviceSdoSession::index

#
CanOpenDeviceSdoSession::next_segment

fn CanOpenDeviceSdoSession::next_segment(self : CanOpenDeviceSdoSession) -> Array[Byte]?

#
CanOpenDeviceSdoSession::offset

#
CanOpenDeviceSdoSession::remaining

#
CanOpenDeviceSdoSession::sub_index

fn CanOpenDeviceSdoSession::sub_index(self : CanOpenDeviceSdoSession) -> Byte

#
CanOpenDeviceSdoSession::toggle

#
CanOpenDeviceSdoSession::upload

#
CanOpenDeviceState

pub enum CanOpenDeviceState {
CanOpenDeviceInitializing
CanOpenDevicePreOperational
CanOpenDeviceOperational
CanOpenDeviceStopped
CanOpenDeviceResetting
}

CANopen NMT state maintained by a device model.

#
CanOpenHeartbeatMonitor

pub struct CanOpenHeartbeatMonitor {
node_id : Byte
timeout_us : UInt64
state : CanOpenHeartbeatState
last_seen_us : UInt64
heartbeats : Int
transitions : Int
}

#
CanOpenHeartbeatMonitor::heartbeats

fn CanOpenHeartbeatMonitor::heartbeats(self : CanOpenHeartbeatMonitor) -> Int

#
CanOpenHeartbeatMonitor::last_seen_us

fn CanOpenHeartbeatMonitor::last_seen_us(self : CanOpenHeartbeatMonitor) -> UInt64

#
CanOpenHeartbeatMonitor::node_id

#
CanOpenHeartbeatMonitor::observe

fn CanOpenHeartbeatMonitor::observe(self : CanOpenHeartbeatMonitor, state_byte : Byte, timestamp_us : UInt64) -> Unit

#
CanOpenHeartbeatMonitor::poll

fn CanOpenHeartbeatMonitor::poll(self : CanOpenHeartbeatMonitor, timestamp_us : UInt64) -> CanOpenHeartbeatState

#
CanOpenHeartbeatMonitor::state

#
CanOpenHeartbeatMonitor::timeout_us

fn CanOpenHeartbeatMonitor::timeout_us(self : CanOpenHeartbeatMonitor) -> UInt64

#
CanOpenHeartbeatMonitor::transitions

fn CanOpenHeartbeatMonitor::transitions(self : CanOpenHeartbeatMonitor) -> Int

#
CanOpenHeartbeatState

pub enum CanOpenHeartbeatState {
CanOpenHeartbeatUnknown
CanOpenHeartbeatAlive
CanOpenHeartbeatTimeout
CanOpenHeartbeatStopped
}

Heartbeat state of a monitored CANopen node.

#
CanOpenNmtCommand

pub(all) enum CanOpenNmtCommand {
Start
Stop
EnterPreOperational
ResetNode
ResetCommunication
}

CANopen NMT state commands.

#
CanOpenObjectAccess

pub enum CanOpenObjectAccess {
CanOpenObjectReadOnly
CanOpenObjectWriteOnly
CanOpenObjectReadWrite
CanOpenObjectConstant
}

Object-dictionary access rights.

#
CanOpenObjectDictionary

pub struct CanOpenObjectDictionary {
entries : Array[CanOpenObjectEntry]
revision : UInt
capacity : Int
}

A bounded object dictionary.

#
CanOpenObjectDictionary::add

#
CanOpenObjectDictionary::entries

#
CanOpenObjectDictionary::find

fn CanOpenObjectDictionary::find(self : CanOpenObjectDictionary, index : UInt, sub_index : Byte) -> CanOpenObjectEntry?

#
CanOpenObjectDictionary::indices

#
CanOpenObjectDictionary::length

#
CanOpenObjectDictionary::read

fn CanOpenObjectDictionary::read(self : CanOpenObjectDictionary, index : UInt, sub_index : Byte) -> Array[Byte]?

#
CanOpenObjectDictionary::replace

#
CanOpenObjectDictionary::revision

#
CanOpenObjectDictionary::to_text

fn CanOpenObjectDictionary::to_text(self : CanOpenObjectDictionary) -> String

#
CanOpenObjectDictionary::write

fn CanOpenObjectDictionary::write(self : CanOpenObjectDictionary, index : UInt, sub_index : Byte, data : Array[Byte]) -> Bool

#
CanOpenObjectEntry

pub struct CanOpenObjectEntry {
index : UInt
sub_index : Byte
name : String
access : CanOpenObjectAccess
data : Array[Byte]
max_length : Int
revision : UInt
}

A typed object-dictionary entry.

#
CanOpenObjectEntry::access

#
CanOpenObjectEntry::data

fn CanOpenObjectEntry::data(self : CanOpenObjectEntry) -> Array[Byte]

#
CanOpenObjectEntry::index

fn CanOpenObjectEntry::index(self : CanOpenObjectEntry) -> UInt

#
CanOpenObjectEntry::max_length

fn CanOpenObjectEntry::max_length(self : CanOpenObjectEntry) -> Int

#
CanOpenObjectEntry::name

fn CanOpenObjectEntry::name(self : CanOpenObjectEntry) -> String

#
CanOpenObjectEntry::read

fn CanOpenObjectEntry::read(self : CanOpenObjectEntry) -> Array[Byte]?

#
CanOpenObjectEntry::readable

fn CanOpenObjectEntry::readable(self : CanOpenObjectEntry) -> Bool

#
CanOpenObjectEntry::revision

fn CanOpenObjectEntry::revision(self : CanOpenObjectEntry) -> UInt

#
CanOpenObjectEntry::sub_index

fn CanOpenObjectEntry::sub_index(self : CanOpenObjectEntry) -> Byte

#
CanOpenObjectEntry::to_text

fn CanOpenObjectEntry::to_text(self : CanOpenObjectEntry) -> String

#
CanOpenObjectEntry::writable

fn CanOpenObjectEntry::writable(self : CanOpenObjectEntry) -> Bool

#
CanOpenObjectEntry::write

fn CanOpenObjectEntry::write(self : CanOpenObjectEntry, data : Array[Byte]) -> Bool

#
CanOpenSdoCommand

pub enum CanOpenSdoCommand {
DownloadInitiate(index~ : UInt, sub_index~ : Byte, data~ : Array[Byte])
UploadInitiate(index~ : UInt, sub_index~ : Byte)
DownloadSegment(toggle~ : Bool, data~ : Array[Byte], last~ : Bool)
UploadSegment(toggle~ : Bool)
Abort(index~ : UInt, sub_index~ : Byte, code~ : UInt)
}

A compact SDO command representation.

#
CanPort

pub struct CanPort {
name : String
capabilities : CanAdapterCapabilities
config : CanAdapterConfig
lifecycle : CanAdapterLifecycle
rx_queue : Array[CanAdapterMessage]
tx_queue : Array[CanAdapterMessage]
sequence : UInt
stats : CanAdapterStats
}

A deterministic in-memory adapter implementing the hardware contract.

#
CanPort::capabilities

fn CanPort::capabilities(self : CanPort) -> CanAdapterCapabilities

#
CanPort::close

fn CanPort::close(self : CanPort) -> Unit

#
CanPort::completion_time_us

fn CanPort::completion_time_us(self : CanPort, message : CanAdapterMessage) -> UInt64

Estimate the wire completion time for a queued frame.

#
CanPort::config

fn CanPort::config(self : CanPort) -> CanAdapterConfig

#
CanPort::configure

fn CanPort::configure(self : CanPort, config : CanAdapterConfig) -> Unit raise CanAdapterError

#
CanPort::drain_rx

fn CanPort::drain_rx(self : CanPort, limit? : Int) -> Array[CanAdapterMessage]

#
CanPort::drain_tx

fn CanPort::drain_tx(self : CanPort, limit? : Int) -> Array[CanAdapterMessage]

#
CanPort::inject

fn CanPort::inject(self : CanPort, timestamp_us : UInt64, frame : Frame) -> Bool

#
CanPort::is_ready

fn CanPort::is_ready(self : CanPort) -> Bool

#
CanPort::lifecycle

fn CanPort::lifecycle(self : CanPort) -> CanAdapterLifecycle

#
CanPort::name

fn CanPort::name(self : CanPort) -> String

#
CanPort::open

fn CanPort::open(self : CanPort) -> Unit raise CanAdapterError

#
CanPort::pending_tx

fn CanPort::pending_tx(self : CanPort) -> Array[CanAdapterMessage]

Return a queue snapshot ordered by timestamp then sequence.

#
CanPort::receive

fn CanPort::receive(self : CanPort) -> CanAdapterMessage?

#
CanPort::recover

fn CanPort::recover(self : CanPort) -> Unit

#
CanPort::rx_pending

fn CanPort::rx_pending(self : CanPort) -> Int

#
CanPort::set_bus_off

fn CanPort::set_bus_off(self : CanPort) -> Unit

#
CanPort::stats

fn CanPort::stats(self : CanPort) -> CanAdapterStats

#
CanPort::transmit

fn CanPort::transmit(self : CanPort, timestamp_us : UInt64, frame : Frame) -> Unit raise CanAdapterError

#
CanPort::tx_pending

fn CanPort::tx_pending(self : CanPort) -> Int

#
CanScheduler

pub struct CanScheduler {
tasks : Array[CanTask]
now_us : UInt64
executed : Int
missed : Int
}

A deterministic task scheduler independent from wall-clock time.

#
CanScheduler::add

fn CanScheduler::add(self : CanScheduler, name : String, frame : Frame, first_due_us : UInt64, period_us : UInt64, deadline_us : UInt64, count : Int) -> Unit raise SchedulerError

Add a task. period_us == 0 creates a one-shot task.

#
CanScheduler::executed

fn CanScheduler::executed(self : CanScheduler) -> Int

#
CanScheduler::find

fn CanScheduler::find(self : CanScheduler, name : String) -> CanTask?

#
CanScheduler::missed

fn CanScheduler::missed(self : CanScheduler) -> Int

#
CanScheduler::next_due

fn CanScheduler::next_due(self : CanScheduler) -> UInt64?

Return the next due time among pending tasks.

#
CanScheduler::now

fn CanScheduler::now(self : CanScheduler) -> UInt64

#
CanScheduler::remove

fn CanScheduler::remove(self : CanScheduler, name : String) -> Unit raise SchedulerError

#
CanScheduler::task_count

fn CanScheduler::task_count(self : CanScheduler) -> Int

#
CanScheduler::tick

fn CanScheduler::tick(self : CanScheduler, timestamp_us : UInt64) -> Array[SchedulerTick] raise SchedulerError

Execute all tasks due by timestamp_us, ordered by CAN arbitration.

#
CanTask

pub struct CanTask {
name : String
frame : Frame
next_due_us : UInt64
period_us : UInt64
deadline_us : UInt64
remaining : Int
priority : Int
}

A periodic or one-shot transmission task.

#
CompatibilityCandidate

pub struct CompatibilityCandidate {
target : CompatibilityTarget
evaluation : CompatibilityEvaluation
rank : Int
}

A ranked compatibility candidate.

#
CompatibilityCandidate::evaluation

#
CompatibilityCandidate::rank

#
CompatibilityCandidate::summary

fn CompatibilityCandidate::summary(self : CompatibilityCandidate) -> String

#
CompatibilityCandidate::target

#
CompatibilityDelta

pub struct CompatibilityDelta {
source : String
destination : String
bitrate_loss : Int
data_bitrate_loss : Int
payload_loss : Int
identifier_loss : Int
node_capacity_loss : Int
lost_features : Array[String]
}

Compare two targets and describe the capabilities that are lost during a downgrade.

#
CompatibilityDelta::bitrate_loss

fn CompatibilityDelta::bitrate_loss(self : CompatibilityDelta) -> Int

#
CompatibilityDelta::data_bitrate_loss

fn CompatibilityDelta::data_bitrate_loss(self : CompatibilityDelta) -> Int

#
CompatibilityDelta::destination

fn CompatibilityDelta::destination(self : CompatibilityDelta) -> String

#
CompatibilityDelta::identifier_loss

fn CompatibilityDelta::identifier_loss(self : CompatibilityDelta) -> Int

#
CompatibilityDelta::is_lossless

fn CompatibilityDelta::is_lossless(self : CompatibilityDelta) -> Bool

#
CompatibilityDelta::lost_features

fn CompatibilityDelta::lost_features(self : CompatibilityDelta) -> Array[String]

#
CompatibilityDelta::node_capacity_loss

fn CompatibilityDelta::node_capacity_loss(self : CompatibilityDelta) -> Int

#
CompatibilityDelta::payload_loss

fn CompatibilityDelta::payload_loss(self : CompatibilityDelta) -> Int

#
CompatibilityDelta::report

fn CompatibilityDelta::report(self : CompatibilityDelta) -> String

#
CompatibilityDelta::source

fn CompatibilityDelta::source(self : CompatibilityDelta) -> String

#
CompatibilityEvaluation

pub struct CompatibilityEvaluation {
target : CompatibilityTarget
issues : Array[CompatibilityIssue]
passed : Int
warnings : Int
failures : Int
score : Int
}

Aggregated result for one target.

#
CompatibilityEvaluation::failures

#
CompatibilityEvaluation::is_compatible

fn CompatibilityEvaluation::is_compatible(self : CompatibilityEvaluation) -> Bool

#
CompatibilityEvaluation::issue_count

fn CompatibilityEvaluation::issue_count(self : CompatibilityEvaluation) -> Int

#
CompatibilityEvaluation::issues

#
CompatibilityEvaluation::passed

#
CompatibilityEvaluation::report

#
CompatibilityEvaluation::score

#
CompatibilityEvaluation::summary

fn CompatibilityEvaluation::summary(self : CompatibilityEvaluation) -> String

#
CompatibilityEvaluation::target

#
CompatibilityEvaluation::warnings

#
CompatibilityFleetSummary

pub struct CompatibilityFleetSummary {
target_count : Int
compatible_count : Int
warning_count : Int
failure_count : Int
average_score : Int
lowest_score : Int
highest_score : Int
}

A fleet-level summary used by acceptance gates and dashboards.

#
CompatibilityFleetSummary::average_score

fn CompatibilityFleetSummary::average_score(self : CompatibilityFleetSummary) -> Int

#
CompatibilityFleetSummary::compatible_count

fn CompatibilityFleetSummary::compatible_count(self : CompatibilityFleetSummary) -> Int

#
CompatibilityFleetSummary::failure_count

fn CompatibilityFleetSummary::failure_count(self : CompatibilityFleetSummary) -> Int

#
CompatibilityFleetSummary::highest_score

fn CompatibilityFleetSummary::highest_score(self : CompatibilityFleetSummary) -> Int

#
CompatibilityFleetSummary::is_release_ready

fn CompatibilityFleetSummary::is_release_ready(self : CompatibilityFleetSummary) -> Bool

#
CompatibilityFleetSummary::lowest_score

#
CompatibilityFleetSummary::target_count

#
CompatibilityFleetSummary::text

#
CompatibilityFleetSummary::warning_count

fn CompatibilityFleetSummary::warning_count(self : CompatibilityFleetSummary) -> Int

#
CompatibilityIssue

pub struct CompatibilityIssue {
target : String
code : String
severity : CompatibilitySeverity
passed : Bool
message : String
observed : String
expected : String
}

A single finding produced while checking a target.

#
CompatibilityIssue::code

fn CompatibilityIssue::code(self : CompatibilityIssue) -> String

#
CompatibilityIssue::expected

fn CompatibilityIssue::expected(self : CompatibilityIssue) -> String

#
CompatibilityIssue::message

fn CompatibilityIssue::message(self : CompatibilityIssue) -> String

#
CompatibilityIssue::observed

fn CompatibilityIssue::observed(self : CompatibilityIssue) -> String

#
CompatibilityIssue::passed

fn CompatibilityIssue::passed(self : CompatibilityIssue) -> Bool

#
CompatibilityIssue::severity

#
CompatibilityIssue::target

fn CompatibilityIssue::target(self : CompatibilityIssue) -> String

#
CompatibilityIssue::text

fn CompatibilityIssue::text(self : CompatibilityIssue) -> String

#
CompatibilityMatrix

pub struct CompatibilityMatrix {
name : String
strict : Bool
targets : Array[CompatibilityTarget]
requirements : Array[CompatibilityRequirement]
}

A matrix of target profiles and production requirements.

#
CompatibilityMatrix::add_requirement

fn CompatibilityMatrix::add_requirement(self : CompatibilityMatrix, requirement : CompatibilityRequirement) -> Unit

#
CompatibilityMatrix::add_target

fn CompatibilityMatrix::add_target(self : CompatibilityMatrix, target : CompatibilityTarget) -> Unit

#
CompatibilityMatrix::best_target

#
CompatibilityMatrix::clear_requirements

fn CompatibilityMatrix::clear_requirements(self : CompatibilityMatrix) -> Unit

#
CompatibilityMatrix::clear_targets

fn CompatibilityMatrix::clear_targets(self : CompatibilityMatrix) -> Unit

#
CompatibilityMatrix::compatible_targets

#
CompatibilityMatrix::csv

fn CompatibilityMatrix::csv(self : CompatibilityMatrix) -> String

#
CompatibilityMatrix::evaluate

#
CompatibilityMatrix::evaluate_all

#
CompatibilityMatrix::fingerprint

fn CompatibilityMatrix::fingerprint(self : CompatibilityMatrix) -> UInt64

Fingerprint all targets in insertion order for reproducible deployment metadata.

#
CompatibilityMatrix::fleet_summary

#
CompatibilityMatrix::name

fn CompatibilityMatrix::name(self : CompatibilityMatrix) -> String

#
CompatibilityMatrix::ranked_candidates

#
CompatibilityMatrix::report

fn CompatibilityMatrix::report(self : CompatibilityMatrix) -> String

#
CompatibilityMatrix::requirement_count

fn CompatibilityMatrix::requirement_count(self : CompatibilityMatrix) -> Int

#
CompatibilityMatrix::requirement_report

fn CompatibilityMatrix::requirement_report(self : CompatibilityMatrix) -> String

#
CompatibilityMatrix::requirements

#
CompatibilityMatrix::requirements_by_severity

Filter requirements by severity for an operator-facing view.

#
CompatibilityMatrix::status

fn CompatibilityMatrix::status(self : CompatibilityMatrix) -> String

Return a short status suitable for a health endpoint.

#
CompatibilityMatrix::strict

fn CompatibilityMatrix::strict(self : CompatibilityMatrix) -> Bool

#
CompatibilityMatrix::target_count

fn CompatibilityMatrix::target_count(self : CompatibilityMatrix) -> Int

#
CompatibilityMatrix::targets

#
CompatibilityProtocol

pub(all) enum CompatibilityProtocol {
CompatibilityClassicCan
CompatibilityCanFd
CompatibilityIsoTp
CompatibilityUds
CompatibilityCanOpen
CompatibilityJ1939
CompatibilityGateway
CompatibilityCustom
}

Protocol families that can be checked by a deployment compatibility matrix.

#
CompatibilityReleaseGate

pub struct CompatibilityReleaseGate {
name : String
matrices : Array[CompatibilityMatrix]
minimum_score : Int
require_all_targets : Bool
}

A named release gate composed of several matrices.

#
CompatibilityReleaseGate::add_matrix

#
CompatibilityReleaseGate::matrix_count

fn CompatibilityReleaseGate::matrix_count(self : CompatibilityReleaseGate) -> Int

#
CompatibilityReleaseGate::minimum_score

fn CompatibilityReleaseGate::minimum_score(self : CompatibilityReleaseGate) -> Int

#
CompatibilityReleaseGate::ready

#
CompatibilityReleaseGate::report

#
CompatibilityReleaseGate::require_all_targets

fn CompatibilityReleaseGate::require_all_targets(self : CompatibilityReleaseGate) -> Bool

#
CompatibilityRequirement

pub struct CompatibilityRequirement {
code : String
description : String
kind : CompatibilityRequirementKind
numeric_value : Int
protocol_value : CompatibilityProtocol?
feature_value : String?
severity : CompatibilitySeverity
}

A reusable requirement for a production target.

#
CompatibilityRequirement::code

#
CompatibilityRequirement::description

fn CompatibilityRequirement::description(self : CompatibilityRequirement) -> String

#
CompatibilityRequirement::feature_value

fn CompatibilityRequirement::feature_value(self : CompatibilityRequirement) -> String?

#
CompatibilityRequirement::numeric_value

fn CompatibilityRequirement::numeric_value(self : CompatibilityRequirement) -> Int

#
CompatibilityRequirement::protocol_value

#
CompatibilityRequirement::severity

#
CompatibilityRequirementKind

pub(all) enum CompatibilityRequirementKind {
CompatibilityMinimumBitrate
CompatibilityMinimumDataBitrate
CompatibilityMinimumPayload
CompatibilityMinimumIdentifierBits
CompatibilityMinimumNodeCapacity
CompatibilityProtocolIs
CompatibilityRequiresFeature
CompatibilityForbidsFeature
CompatibilityRequiresFd
CompatibilityRequiresClassic
CompatibilityRequiresIsoTp
CompatibilityRequiresDiagnostics
}

A machine-readable kind of capability requirement.

#
CompatibilityRoute

pub struct CompatibilityRoute {
source : CompatibilityTarget
destination : CompatibilityTarget
transport : CompatibilityProtocol
max_payload : Int
uses_segmentation : Bool
valid : Bool
reason : String
}

Validate a route between two protocol endpoints.

#
CompatibilityRoute::destination

#
CompatibilityRoute::max_payload

fn CompatibilityRoute::max_payload(self : CompatibilityRoute) -> Int

#
CompatibilityRoute::reason

fn CompatibilityRoute::reason(self : CompatibilityRoute) -> String

#
CompatibilityRoute::source

#
CompatibilityRoute::summary

fn CompatibilityRoute::summary(self : CompatibilityRoute) -> String

#
CompatibilityRoute::transport

#
CompatibilityRoute::uses_segmentation

fn CompatibilityRoute::uses_segmentation(self : CompatibilityRoute) -> Bool

#
CompatibilityRoute::valid

fn CompatibilityRoute::valid(self : CompatibilityRoute) -> Bool

#
CompatibilityRouteTable

pub struct CompatibilityRouteTable {
routes : Array[CompatibilityRoute]
}

A route table that prevents unsupported forwarding paths from reaching runtime.

#
CompatibilityRouteTable::add

#
CompatibilityRouteTable::invalid_routes

#
CompatibilityRouteTable::report

#
CompatibilityRouteTable::routes

#
CompatibilityRouteTable::valid_routes

#
CompatibilitySeverity

pub(all) enum CompatibilitySeverity {
CompatibilityInfo
CompatibilityWarning
CompatibilityError
}

The level attached to a requirement or finding.

#
CompatibilityTarget

pub struct CompatibilityTarget {
name : String
protocol : CompatibilityProtocol
nominal_bitrate : Int
data_bitrate : Int
max_payload : Int
identifier_bits : Int
node_capacity : Int
features : Array[String]
notes : String
}

A deployment target and the capabilities it advertises.

#
CompatibilityTarget::data_bitrate

fn CompatibilityTarget::data_bitrate(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::feature_count

fn CompatibilityTarget::feature_count(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::feature_csv

fn CompatibilityTarget::feature_csv(self : CompatibilityTarget) -> String

#
CompatibilityTarget::features

fn CompatibilityTarget::features(self : CompatibilityTarget) -> Array[String]

#
CompatibilityTarget::has_feature

fn CompatibilityTarget::has_feature(self : CompatibilityTarget, wanted : String) -> Bool

#
CompatibilityTarget::identifier_bits

fn CompatibilityTarget::identifier_bits(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::max_payload

fn CompatibilityTarget::max_payload(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::name

fn CompatibilityTarget::name(self : CompatibilityTarget) -> String

#
CompatibilityTarget::node_capacity

fn CompatibilityTarget::node_capacity(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::nominal_bitrate

fn CompatibilityTarget::nominal_bitrate(self : CompatibilityTarget) -> Int

#
CompatibilityTarget::notes

fn CompatibilityTarget::notes(self : CompatibilityTarget) -> String

#
CompatibilityTarget::protocol

#
CompatibilityTarget::summary

fn CompatibilityTarget::summary(self : CompatibilityTarget) -> String

#
DbcCodegenOptions

pub struct DbcCodegenOptions {
target : DbcCodegenTarget
module_name : String
include_comments : Bool
include_validation : Bool
line_ending : String
}

Options used by a deterministic DBC artifact generator.

#
DbcCodegenOptions::include_comments

fn DbcCodegenOptions::include_comments(self : DbcCodegenOptions) -> Bool

#
DbcCodegenOptions::include_validation

fn DbcCodegenOptions::include_validation(self : DbcCodegenOptions) -> Bool

#
DbcCodegenOptions::line_ending

fn DbcCodegenOptions::line_ending(self : DbcCodegenOptions) -> String

#
DbcCodegenOptions::module_name

fn DbcCodegenOptions::module_name(self : DbcCodegenOptions) -> String

#
DbcCodegenOptions::target

#
DbcCodegenTarget

pub enum DbcCodegenTarget {
DbcCodegenMoonBit
DbcCodegenCHeader
DbcCodegenJsonSchema
DbcCodegenMarkdown
}

Output dialect for generated DBC integration artifacts.

#
DbcDatabase

pub struct DbcDatabase {
messages : Array[Message]
}

A lookup table for message definitions.

#
DbcDatabase::add

fn DbcDatabase::add(self : DbcDatabase, item : Message) -> Unit raise DbcRuntimeError

Add a message definition, rejecting duplicate numeric identifiers.

#
DbcDatabase::by_id

fn DbcDatabase::by_id(self : DbcDatabase, id : UInt) -> Message?

Find a message by CAN identifier.

#
DbcDatabase::by_name

fn DbcDatabase::by_name(self : DbcDatabase, name : String) -> Message?

Find a message by its symbolic name.

#
DbcDatabase::decode_frame

fn DbcDatabase::decode_frame(self : DbcDatabase, frame : Frame) -> DecodedMessage? raise DbcRuntimeError

Decode a frame using the message selected by its identifier.

#
DbcDatabase::ids

fn DbcDatabase::ids(self : DbcDatabase) -> Array[UInt]

Return all numeric message identifiers.

#
DbcDatabase::length

fn DbcDatabase::length(self : DbcDatabase) -> Int

Return the number of definitions.

#
DbcDatabase::messages

fn DbcDatabase::messages(self : DbcDatabase) -> Array[Message]

Return all message definitions in source order.

#
DbcGeneratedArtifact

pub struct DbcGeneratedArtifact {
path : String
target : DbcCodegenTarget
content : String
line_count : Int
message_count : Int
signal_count : Int
warnings : Array[String]
}

A generated artifact with reproducible metadata.

#
DbcGeneratedArtifact::content

fn DbcGeneratedArtifact::content(self : DbcGeneratedArtifact) -> String

#
DbcGeneratedArtifact::line_count

fn DbcGeneratedArtifact::line_count(self : DbcGeneratedArtifact) -> Int

#
DbcGeneratedArtifact::message_count

fn DbcGeneratedArtifact::message_count(self : DbcGeneratedArtifact) -> Int

#
DbcGeneratedArtifact::path

fn DbcGeneratedArtifact::path(self : DbcGeneratedArtifact) -> String

#
DbcGeneratedArtifact::signal_count

fn DbcGeneratedArtifact::signal_count(self : DbcGeneratedArtifact) -> Int

#
DbcGeneratedArtifact::target

#
DbcGeneratedArtifact::warnings

fn DbcGeneratedArtifact::warnings(self : DbcGeneratedArtifact) -> Array[String]

#
DbcParseReport

pub struct DbcParseReport {
messages : Array[Message]
ignored_lines : Int
signal_lines : Int
}

A parse result that records ignored non-semantic lines.

#
DbcParseReport::ignored_lines

fn DbcParseReport::ignored_lines(self : DbcParseReport) -> Int

#
DbcParseReport::message_count

fn DbcParseReport::message_count(self : DbcParseReport) -> Int

#
DbcParseReport::messages

fn DbcParseReport::messages(self : DbcParseReport) -> Array[Message]

#
DbcParseReport::signal_lines

fn DbcParseReport::signal_lines(self : DbcParseReport) -> Int

#
DbcSchemaChange

pub struct DbcSchemaChange {
id : UInt
kind : String
before : String?
after : String?
}

A single schema difference between two message collections.

#
DbcSchemaChange::after

fn DbcSchemaChange::after(self : DbcSchemaChange) -> String?

#
DbcSchemaChange::before

fn DbcSchemaChange::before(self : DbcSchemaChange) -> String?

#
DbcSchemaChange::id

fn DbcSchemaChange::id(self : DbcSchemaChange) -> UInt

#
DbcSchemaChange::kind

fn DbcSchemaChange::kind(self : DbcSchemaChange) -> String

#
DbcSchemaReport

pub struct DbcSchemaReport {
message_count : Int
signal_count : Int
unique_identifier_count : Int
maximum_required_bytes : Int
}

Stable statistics for a validated DBC schema.

#
DbcSchemaReport::maximum_required_bytes

fn DbcSchemaReport::maximum_required_bytes(self : DbcSchemaReport) -> Int

#
DbcSchemaReport::message_count

fn DbcSchemaReport::message_count(self : DbcSchemaReport) -> Int

#
DbcSchemaReport::signal_count

fn DbcSchemaReport::signal_count(self : DbcSchemaReport) -> Int

#
DbcSchemaReport::unique_identifier_count

fn DbcSchemaReport::unique_identifier_count(self : DbcSchemaReport) -> Int

#
DbcWorkspace

pub struct DbcWorkspace {
messages : Array[Message]
groups : Array[DbcWorkspaceSignalGroup]
bindings : Array[DbcWorkspaceBinding]
revision : UInt
encoded_frames : Int
decoded_frames : Int
}

A runtime registry for DBC schemas, groups and bindings.

#
DbcWorkspace::add_binding

fn DbcWorkspace::add_binding(self : DbcWorkspace, binding : DbcWorkspaceBinding) -> Bool

#
DbcWorkspace::add_group

fn DbcWorkspace::add_group(self : DbcWorkspace, group : DbcWorkspaceSignalGroup) -> Bool

#
DbcWorkspace::add_message

fn DbcWorkspace::add_message(self : DbcWorkspace, item : Message) -> Bool

#
DbcWorkspace::bindings

#
DbcWorkspace::by_id

fn DbcWorkspace::by_id(self : DbcWorkspace, id : UInt) -> Message?

#
DbcWorkspace::by_name

fn DbcWorkspace::by_name(self : DbcWorkspace, name : String) -> Message?

#
DbcWorkspace::decode

fn DbcWorkspace::decode(self : DbcWorkspace, frame : Frame) -> DecodedMessage? raise DbcRuntimeError

Decode a frame using its message identifier.

#
DbcWorkspace::decoded_frames

fn DbcWorkspace::decoded_frames(self : DbcWorkspace) -> Int

#
DbcWorkspace::encode

fn DbcWorkspace::encode(self : DbcWorkspace, name : String, values : DbcWorkspaceValueSet) -> Frame raise DbcRuntimeError

Encode a named binding into a CAN frame.

#
DbcWorkspace::encoded_frames

fn DbcWorkspace::encoded_frames(self : DbcWorkspace) -> Int

#
DbcWorkspace::find_binding

fn DbcWorkspace::find_binding(self : DbcWorkspace, name : String) -> DbcWorkspaceBinding?

#
DbcWorkspace::find_group

fn DbcWorkspace::find_group(self : DbcWorkspace, name : String) -> DbcWorkspaceSignalGroup?

#
DbcWorkspace::fingerprint

fn DbcWorkspace::fingerprint(self : DbcWorkspace) -> UInt

Return a compact fingerprint for cache keys and CI artifacts.

#
DbcWorkspace::groups

#
DbcWorkspace::ids

fn DbcWorkspace::ids(self : DbcWorkspace) -> Array[UInt]

Return all message identifiers sorted for deterministic reports.

#
DbcWorkspace::messages

fn DbcWorkspace::messages(self : DbcWorkspace) -> Array[Message]

#
DbcWorkspace::replace_message

fn DbcWorkspace::replace_message(self : DbcWorkspace, item : Message) -> Bool

#
DbcWorkspace::revision

fn DbcWorkspace::revision(self : DbcWorkspace) -> UInt

#
DbcWorkspace::schema_text

fn DbcWorkspace::schema_text(self : DbcWorkspace) -> String

Return a stable, human-readable workspace schema summary.

#
DbcWorkspace::validate

Validate messages, groups, bindings and duplicate identifiers.

#
DbcWorkspaceBinding

pub struct DbcWorkspaceBinding {
name : String
message : Message
selector : DbcWorkspaceMuxSelector
extended : Bool
default_values : DbcWorkspaceValueSet
encoded : Int
decoded : Int
}

A message binding with a stable runtime name and mux selector.

#
DbcWorkspaceBinding::decode

#
DbcWorkspaceBinding::decoded

fn DbcWorkspaceBinding::decoded(self : DbcWorkspaceBinding) -> Int

#
DbcWorkspaceBinding::defaults

#
DbcWorkspaceBinding::encode

#
DbcWorkspaceBinding::encoded

fn DbcWorkspaceBinding::encoded(self : DbcWorkspaceBinding) -> Int

#
DbcWorkspaceBinding::extended

fn DbcWorkspaceBinding::extended(self : DbcWorkspaceBinding) -> Bool

#
DbcWorkspaceBinding::matches_mux

fn DbcWorkspaceBinding::matches_mux(self : DbcWorkspaceBinding, mux : UInt) -> Bool

#
DbcWorkspaceBinding::message

#
DbcWorkspaceBinding::name

fn DbcWorkspaceBinding::name(self : DbcWorkspaceBinding) -> String

#
DbcWorkspaceBinding::selector

#
DbcWorkspaceBinding::set_default

fn DbcWorkspaceBinding::set_default(self : DbcWorkspaceBinding, values : DbcWorkspaceValueSet) -> Unit

#
DbcWorkspaceIssue

pub enum DbcWorkspaceIssue {
DbcWorkspaceDuplicateId(UInt)
DbcWorkspaceDuplicateName(String)
DbcWorkspaceInvalidMessage(String)
DbcWorkspaceMissingBinding(UInt)
DbcWorkspaceEmptyGroup(String)
DbcWorkspaceMuxConflict(String)
}

A schema finding returned by workspace validation.

#
DbcWorkspaceMuxSelector

pub enum DbcWorkspaceMuxSelector {
DbcWorkspaceMuxNone
DbcWorkspaceMuxValue(UInt)
DbcWorkspaceMuxRange(UInt, UInt)
}

Selection rule for a multiplexed DBC message.

#
DbcWorkspaceSignalGroup

pub struct DbcWorkspaceSignalGroup {
name : String
message_id : UInt
signals : Array[Signal]
active : Bool
}

A named group of DBC signals used by a calibration tool.

#
DbcWorkspaceSignalGroup::active

#
DbcWorkspaceSignalGroup::add_signal

fn DbcWorkspaceSignalGroup::add_signal(self : DbcWorkspaceSignalGroup, item : Signal) -> Bool

#
DbcWorkspaceSignalGroup::contains

fn DbcWorkspaceSignalGroup::contains(self : DbcWorkspaceSignalGroup, name : String) -> Bool

#
DbcWorkspaceSignalGroup::find

fn DbcWorkspaceSignalGroup::find(self : DbcWorkspaceSignalGroup, name : String) -> Signal?

#
DbcWorkspaceSignalGroup::length

#
DbcWorkspaceSignalGroup::message_id

fn DbcWorkspaceSignalGroup::message_id(self : DbcWorkspaceSignalGroup) -> UInt

#
DbcWorkspaceSignalGroup::name

#
DbcWorkspaceSignalGroup::set_active

fn DbcWorkspaceSignalGroup::set_active(self : DbcWorkspaceSignalGroup, active : Bool) -> Unit

#
DbcWorkspaceSignalGroup::signals

#
DbcWorkspaceValue

pub struct DbcWorkspaceValue {
name : String
value : Double
}

A physical value associated with a named DBC signal.

#
DbcWorkspaceValue::name

fn DbcWorkspaceValue::name(self : DbcWorkspaceValue) -> String

#
DbcWorkspaceValue::value

fn DbcWorkspaceValue::value(self : DbcWorkspaceValue) -> Double

#
DbcWorkspaceValueSet

pub struct DbcWorkspaceValueSet {
values : Array[DbcWorkspaceValue]
revision : UInt
}

A deterministic value set that can be converted to a DBC map.

#
DbcWorkspaceValueSet::contains

fn DbcWorkspaceValueSet::contains(self : DbcWorkspaceValueSet, name : String) -> Bool

#
DbcWorkspaceValueSet::find

fn DbcWorkspaceValueSet::find(self : DbcWorkspaceValueSet, name : String) -> DbcWorkspaceValue?

#
DbcWorkspaceValueSet::names

fn DbcWorkspaceValueSet::names(self : DbcWorkspaceValueSet) -> Array[String]

#
DbcWorkspaceValueSet::put

#
DbcWorkspaceValueSet::put_number

fn DbcWorkspaceValueSet::put_number(self : DbcWorkspaceValueSet, name : String, value : Double) -> Unit

#
DbcWorkspaceValueSet::remove

fn DbcWorkspaceValueSet::remove(self : DbcWorkspaceValueSet, name : String) -> Bool

#
DbcWorkspaceValueSet::revision

fn DbcWorkspaceValueSet::revision(self : DbcWorkspaceValueSet) -> UInt

#
DbcWorkspaceValueSet::to_map

fn DbcWorkspaceValueSet::to_map(self : DbcWorkspaceValueSet) -> Map[String, Double]

#
DbcWorkspaceValueSet::values

#
DecodedMessage

pub struct DecodedMessage {
id : UInt
name : String
signals : Array[DecodedSignal]
}

A decoded DBC message with the source identifier.

#
DecodedMessage::find

fn DecodedMessage::find(self : DecodedMessage, name : String) -> DecodedSignal?

Find a decoded value by signal name.

#
DecodedMessage::id

fn DecodedMessage::id(self : DecodedMessage) -> UInt

Return the message identifier from a decoded message.

#
DecodedMessage::name

fn DecodedMessage::name(self : DecodedMessage) -> String

Return the message name from a decoded message.

#
DecodedMessage::signals

Return decoded signals.

#
DecodedMessage::to_text

fn DecodedMessage::to_text(self : DecodedMessage) -> String

Render a decoded message as a stable diagnostic line.

#
DecodedSignal

pub struct DecodedSignal {
name : String
raw : UInt
physical : Double
unit : String
}

A decoded physical signal value.

#
DecodedSignal::name

fn DecodedSignal::name(self : DecodedSignal) -> String

#
DecodedSignal::physical

fn DecodedSignal::physical(self : DecodedSignal) -> Double

#
DecodedSignal::raw

fn DecodedSignal::raw(self : DecodedSignal) -> UInt

#
DecodedSignal::unit

fn DecodedSignal::unit(self : DecodedSignal) -> String

#
DiagnosticAddressingMode

pub enum DiagnosticAddressingMode {
NormalAddressing
ExtendedAddressing
MixedAddressing(Byte)
}

Addressing modes supported by a diagnostic transport endpoint.

#
DiagnosticDataIdentifier

pub struct DiagnosticDataIdentifier {
identifier : UInt
name : String
length : Int
readable : Bool
writable : Bool
value : Array[Byte]
}

A data identifier entry exposed by an ECU.

#
DiagnosticDataIdentifier::identifier

fn DiagnosticDataIdentifier::identifier(self : DiagnosticDataIdentifier) -> UInt

#
DiagnosticDataIdentifier::length

#
DiagnosticDataIdentifier::name

#
DiagnosticDataIdentifier::read_value

Return the readable value padded to the configured length.

#
DiagnosticDataIdentifier::readable

#
DiagnosticDataIdentifier::set_value

fn DiagnosticDataIdentifier::set_value(self : DiagnosticDataIdentifier, value : Array[Byte]) -> Bool

Update a DID value, applying the configured maximum length.

#
DiagnosticDataIdentifier::value

#
DiagnosticDataIdentifier::writable

#
DiagnosticDataTable

pub struct DiagnosticDataTable {
entries : Array[DiagnosticDataIdentifier]
revision : UInt
}

A table of ECU data identifiers.

#
DiagnosticDataTable::add

#
DiagnosticDataTable::entries

#
DiagnosticDataTable::find

fn DiagnosticDataTable::find(self : DiagnosticDataTable, identifier : UInt) -> DiagnosticDataIdentifier?

#
DiagnosticDataTable::identifiers

fn DiagnosticDataTable::identifiers(self : DiagnosticDataTable) -> Array[UInt]

#
DiagnosticDataTable::length

fn DiagnosticDataTable::length(self : DiagnosticDataTable) -> Int

#
DiagnosticDataTable::read

fn DiagnosticDataTable::read(self : DiagnosticDataTable, identifier : UInt) -> Array[Byte]?

#
DiagnosticDataTable::replace

#
DiagnosticDataTable::revision

fn DiagnosticDataTable::revision(self : DiagnosticDataTable) -> UInt

#
DiagnosticDataTable::to_text

fn DiagnosticDataTable::to_text(self : DiagnosticDataTable) -> String

#
DiagnosticDataTable::write

fn DiagnosticDataTable::write(self : DiagnosticDataTable, identifier : UInt, value : Array[Byte]) -> Bool

#
DiagnosticEvent

pub struct DiagnosticEvent {
timestamp_us : UInt64
request : DiagnosticRequest
response : Array[Byte]
positive : Bool
duration_us : UInt64
}

A diagnostic event suitable for a tester trace.

#
DiagnosticEvent::duration_us

fn DiagnosticEvent::duration_us(self : DiagnosticEvent) -> UInt64

#
DiagnosticEvent::positive

fn DiagnosticEvent::positive(self : DiagnosticEvent) -> Bool

#
DiagnosticEvent::request

#
DiagnosticEvent::response

fn DiagnosticEvent::response(self : DiagnosticEvent) -> Array[Byte]

#
DiagnosticEvent::timestamp_us

fn DiagnosticEvent::timestamp_us(self : DiagnosticEvent) -> UInt64

#
DiagnosticExchangeLog

pub struct DiagnosticExchangeLog {
events : Array[DiagnosticEvent]
positive_count : Int
negative_count : Int
}

An ordered diagnostic exchange log.

#
DiagnosticExchangeLog::average_duration_us

fn DiagnosticExchangeLog::average_duration_us(self : DiagnosticExchangeLog) -> UInt64

#
DiagnosticExchangeLog::events

#
DiagnosticExchangeLog::failed_services

fn DiagnosticExchangeLog::failed_services(self : DiagnosticExchangeLog) -> Array[String]

#
DiagnosticExchangeLog::length

#
DiagnosticExchangeLog::negative_count

fn DiagnosticExchangeLog::negative_count(self : DiagnosticExchangeLog) -> Int

#
DiagnosticExchangeLog::positive_count

fn DiagnosticExchangeLog::positive_count(self : DiagnosticExchangeLog) -> Int

#
DiagnosticExchangeLog::record

fn DiagnosticExchangeLog::record(self : DiagnosticExchangeLog, event : DiagnosticEvent) -> Unit

#
DiagnosticExchangeLog::to_text

fn DiagnosticExchangeLog::to_text(self : DiagnosticExchangeLog) -> String

#
DiagnosticReadiness

pub struct DiagnosticReadiness {
session_ok : Bool
security_ok : Bool
voltage_ok : Bool
temperature_ok : Bool
dtc_ok : Bool
reasons : Array[String]
}

A readiness check used before programming or calibration.

#
DiagnosticReadiness::dtc_ok

fn DiagnosticReadiness::dtc_ok(self : DiagnosticReadiness) -> Bool

#
DiagnosticReadiness::ready

fn DiagnosticReadiness::ready(self : DiagnosticReadiness) -> Bool

#
DiagnosticReadiness::reasons

fn DiagnosticReadiness::reasons(self : DiagnosticReadiness) -> Array[String]

#
DiagnosticReadiness::security_ok

fn DiagnosticReadiness::security_ok(self : DiagnosticReadiness) -> Bool

#
DiagnosticReadiness::session_ok

fn DiagnosticReadiness::session_ok(self : DiagnosticReadiness) -> Bool

#
DiagnosticReadiness::temperature_ok

fn DiagnosticReadiness::temperature_ok(self : DiagnosticReadiness) -> Bool

#
DiagnosticReadiness::voltage_ok

fn DiagnosticReadiness::voltage_ok(self : DiagnosticReadiness) -> Bool

#
DiagnosticRequest

pub struct DiagnosticRequest {
service : UdsService
payload : Array[Byte]
}

A diagnostic request represented as a CAN payload.

#
DiagnosticRequest::payload

fn DiagnosticRequest::payload(self : DiagnosticRequest) -> Array[Byte]

Return a defensive copy of the UDS payload.

#
DiagnosticRequest::service

Return the service kind.

#
DiagnosticRequest::service_id

fn DiagnosticRequest::service_id(self : DiagnosticRequest) -> Byte

Return the request's numeric service identifier.

#
DiagnosticRequest::service_name

fn DiagnosticRequest::service_name(self : DiagnosticRequest) -> String

Return the service's name.

#
DiagnosticRequest::suppress_response

fn DiagnosticRequest::suppress_response(self : DiagnosticRequest) -> Bool

Return whether a request contains a suppress-positive-response bit.

#
DiagnosticResponse

pub enum DiagnosticResponse {
Positive(Array[Byte])
Negative(code~ : Byte)
Malformed
}

A response classification for a diagnostic exchange.

#
DiagnosticRetryPolicy

pub struct DiagnosticRetryPolicy {
max_attempts : Int
backoff_us : UInt64
retry_negative : Bool
attempts : Int
}

Retry policy used by a diagnostic workflow step.

#
DiagnosticRetryPolicy::attempts

fn DiagnosticRetryPolicy::attempts(self : DiagnosticRetryPolicy) -> Int

#
DiagnosticRetryPolicy::backoff_us

fn DiagnosticRetryPolicy::backoff_us(self : DiagnosticRetryPolicy) -> UInt64

#
DiagnosticRetryPolicy::begin_attempt

fn DiagnosticRetryPolicy::begin_attempt(self : DiagnosticRetryPolicy) -> Bool

#
DiagnosticRetryPolicy::can_retry

fn DiagnosticRetryPolicy::can_retry(self : DiagnosticRetryPolicy) -> Bool

#
DiagnosticRetryPolicy::max_attempts

fn DiagnosticRetryPolicy::max_attempts(self : DiagnosticRetryPolicy) -> Int

#
DiagnosticRetryPolicy::reset

#
DiagnosticRetryPolicy::retry_negative

fn DiagnosticRetryPolicy::retry_negative(self : DiagnosticRetryPolicy) -> Bool

#
DiagnosticSessionKind

pub enum DiagnosticSessionKind {
DefaultSession
ProgrammingSession
ExtendedSession
SafetySystemSession
SupplierSession(Byte)
}

A diagnostic application session defined by ISO 14229.

#
DiagnosticSessionProfile

pub struct DiagnosticSessionProfile {
kind : DiagnosticSessionKind
p2_server_us : UInt64
p2_star_server_us : UInt64
s3_server_us : UInt64
addressing : DiagnosticAddressingMode
security_level : Byte
}

Timing and security policy for a diagnostic session.

#
DiagnosticSessionProfile::addressing

Return the addressing mode.

#
DiagnosticSessionProfile::kind

Return the session kind.

#
DiagnosticSessionProfile::p2_server_us

fn DiagnosticSessionProfile::p2_server_us(self : DiagnosticSessionProfile) -> UInt64

Return the P2 timeout in microseconds.

#
DiagnosticSessionProfile::p2_star_server_us

fn DiagnosticSessionProfile::p2_star_server_us(self : DiagnosticSessionProfile) -> UInt64

Return the P2-star timeout in microseconds.

#
DiagnosticSessionProfile::s3_server_us

fn DiagnosticSessionProfile::s3_server_us(self : DiagnosticSessionProfile) -> UInt64

Return the S3 timeout in microseconds.

#
DiagnosticSessionProfile::security_level

fn DiagnosticSessionProfile::security_level(self : DiagnosticSessionProfile) -> Byte

Return the required security level.

#
DiagnosticTroubleCode

pub struct DiagnosticTroubleCode {
code : UInt
status : Byte
severity : Byte
occurrence_count : Int
snapshot : Array[Byte]
extended_data : Array[Byte]
last_seen_us : UInt64
}

A normalized diagnostic trouble code record.

#
DiagnosticTroubleCode::code

Return the numeric DTC code.

#
DiagnosticTroubleCode::extended_data

fn DiagnosticTroubleCode::extended_data(self : DiagnosticTroubleCode) -> Array[Byte]

Return a copy of the extended DTC data.

#
DiagnosticTroubleCode::has_status

fn DiagnosticTroubleCode::has_status(self : DiagnosticTroubleCode, bit : DtcStatusBit) -> Bool

Return whether a status bit is set.

#
DiagnosticTroubleCode::last_seen_us

fn DiagnosticTroubleCode::last_seen_us(self : DiagnosticTroubleCode) -> UInt64

Return the most recent observation timestamp.

#
DiagnosticTroubleCode::observe

fn DiagnosticTroubleCode::observe(self : DiagnosticTroubleCode, status : Byte, timestamp_us : UInt64) -> Unit

Apply a new observation to a DTC record.

#
DiagnosticTroubleCode::occurrence_count

fn DiagnosticTroubleCode::occurrence_count(self : DiagnosticTroubleCode) -> Int

Return the number of observed occurrences.

#
DiagnosticTroubleCode::set_extended_data

fn DiagnosticTroubleCode::set_extended_data(self : DiagnosticTroubleCode, data : Array[Byte]) -> Unit

Add or update extended DTC data.

#
DiagnosticTroubleCode::set_snapshot

fn DiagnosticTroubleCode::set_snapshot(self : DiagnosticTroubleCode, data : Array[Byte]) -> Unit

Add or update a freeze-frame snapshot.

#
DiagnosticTroubleCode::severity

fn DiagnosticTroubleCode::severity(self : DiagnosticTroubleCode) -> Byte

Return the configured severity byte.

#
DiagnosticTroubleCode::snapshot

fn DiagnosticTroubleCode::snapshot(self : DiagnosticTroubleCode) -> Array[Byte]

Return a copy of the freeze-frame snapshot.

#
DiagnosticTroubleCode::status

fn DiagnosticTroubleCode::status(self : DiagnosticTroubleCode) -> Byte

Return the raw UDS status byte.

#
DiagnosticTroubleCode::status_text

fn DiagnosticTroubleCode::status_text(self : DiagnosticTroubleCode) -> String

Return a human-readable status summary.

#
DiagnosticTroubleCode::to_bytes

fn DiagnosticTroubleCode::to_bytes(self : DiagnosticTroubleCode) -> Array[Byte]

Serialize a DTC into the three-byte code plus status byte form.

#
DiagnosticTroubleCodeStore

pub struct DiagnosticTroubleCodeStore {
capacity : Int
records : Array[DiagnosticTroubleCode]
generation : UInt
cleared_at_us : UInt64
}

A bounded DTC store suitable for an ECU simulator or gateway.

#
DiagnosticTroubleCodeStore::capacity

Return the configured store capacity.

#
DiagnosticTroubleCodeStore::clear

fn DiagnosticTroubleCodeStore::clear(self : DiagnosticTroubleCodeStore, timestamp_us : UInt64) -> Unit

Clear all records and update the clear timestamp.

#
DiagnosticTroubleCodeStore::cleared_at_us

fn DiagnosticTroubleCodeStore::cleared_at_us(self : DiagnosticTroubleCodeStore) -> UInt64

Return the timestamp of the last clear operation.

#
DiagnosticTroubleCodeStore::codes

Return all DTC codes sorted numerically.

#
DiagnosticTroubleCodeStore::encode_report

fn DiagnosticTroubleCodeStore::encode_report(self : DiagnosticTroubleCodeStore, selector : DtcQuery, limit? : Int) -> Array[Byte]

Encode a DTC response payload for ReadDTCInformation.

#
DiagnosticTroubleCodeStore::find

Find a DTC by numeric code.

#
DiagnosticTroubleCodeStore::generation

Return the mutation generation.

#
DiagnosticTroubleCodeStore::length

Return the number of stored DTCs.

#
DiagnosticTroubleCodeStore::mark_cycle_start

fn DiagnosticTroubleCodeStore::mark_cycle_start(self : DiagnosticTroubleCodeStore) -> Unit

Mark every stored DTC as not completed since clear.

#
DiagnosticTroubleCodeStore::query

Query all matching DTCs in insertion order.

#
DiagnosticTroubleCodeStore::record

Add a new DTC or update an existing code.

#
DiagnosticTroubleCodeStore::records

Return a defensive copy of all records.

#
DiagnosticTroubleCodeStore::remove

fn DiagnosticTroubleCodeStore::remove(self : DiagnosticTroubleCodeStore, code : UInt) -> Bool

Remove one DTC by code and return whether it existed.

#
DiagnosticWorkflow

pub struct DiagnosticWorkflow {
steps : Array[DiagnosticWorkflowStep]
results : Array[DiagnosticWorkflowResult]
cursor : Int
state : DiagnosticWorkflowState
started_us : UInt64
last_timestamp_us : UInt64
failures : Int
}

A sequential diagnostic workflow runner.

#
DiagnosticWorkflow::accept_current

fn DiagnosticWorkflow::accept_current(self : DiagnosticWorkflow, payload : Array[Byte], timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflow::add

#
DiagnosticWorkflow::begin_current

fn DiagnosticWorkflow::begin_current(self : DiagnosticWorkflow, timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflow::cancel

fn DiagnosticWorkflow::cancel(self : DiagnosticWorkflow) -> Unit

#
DiagnosticWorkflow::continue_after_wait

fn DiagnosticWorkflow::continue_after_wait(self : DiagnosticWorkflow) -> Bool

#
DiagnosticWorkflow::current

#
DiagnosticWorkflow::cursor

fn DiagnosticWorkflow::cursor(self : DiagnosticWorkflow) -> Int

#
DiagnosticWorkflow::failures

fn DiagnosticWorkflow::failures(self : DiagnosticWorkflow) -> Int

#
DiagnosticWorkflow::last_timestamp_us

fn DiagnosticWorkflow::last_timestamp_us(self : DiagnosticWorkflow) -> UInt64

#
DiagnosticWorkflow::length

fn DiagnosticWorkflow::length(self : DiagnosticWorkflow) -> Int

#
DiagnosticWorkflow::poll_timeout

fn DiagnosticWorkflow::poll_timeout(self : DiagnosticWorkflow, timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflow::progress_percent

fn DiagnosticWorkflow::progress_percent(self : DiagnosticWorkflow) -> Int

#
DiagnosticWorkflow::reset

fn DiagnosticWorkflow::reset(self : DiagnosticWorkflow) -> Unit

#
DiagnosticWorkflow::results

#
DiagnosticWorkflow::start

fn DiagnosticWorkflow::start(self : DiagnosticWorkflow, timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflow::started_us

fn DiagnosticWorkflow::started_us(self : DiagnosticWorkflow) -> UInt64

#
DiagnosticWorkflow::state

#
DiagnosticWorkflow::successful

fn DiagnosticWorkflow::successful(self : DiagnosticWorkflow) -> Bool

#
DiagnosticWorkflow::to_text

fn DiagnosticWorkflow::to_text(self : DiagnosticWorkflow) -> String

#
DiagnosticWorkflowResult

pub struct DiagnosticWorkflowResult {
step_name : String
service : String
positive : Bool
attempts : Int
duration_us : UInt64
response : DiagnosticResponse
}

A result record retained after a workflow step completes.

#
DiagnosticWorkflowResult::attempts

#
DiagnosticWorkflowResult::duration_us

fn DiagnosticWorkflowResult::duration_us(self : DiagnosticWorkflowResult) -> UInt64

#
DiagnosticWorkflowResult::positive

#
DiagnosticWorkflowResult::response

#
DiagnosticWorkflowResult::service

#
DiagnosticWorkflowResult::step_name

fn DiagnosticWorkflowResult::step_name(self : DiagnosticWorkflowResult) -> String

#
DiagnosticWorkflowState

pub enum DiagnosticWorkflowState {
DiagnosticWorkflowIdle
DiagnosticWorkflowRunning
DiagnosticWorkflowWaiting
DiagnosticWorkflowSucceeded
DiagnosticWorkflowFailed
DiagnosticWorkflowCancelled
}

State of a deterministic diagnostic workflow.

#
DiagnosticWorkflowStep

pub struct DiagnosticWorkflowStep {
name : String
request : DiagnosticRequest
timeout_us : UInt64
retry : DiagnosticRetryPolicy
sent_at_us : UInt64?
completed : Bool
result : DiagnosticResponse?
}

One request scheduled in a diagnostic workflow.

#
DiagnosticWorkflowStep::accept

fn DiagnosticWorkflowStep::accept(self : DiagnosticWorkflowStep, payload : Array[Byte]) -> Bool

#
DiagnosticWorkflowStep::begin

fn DiagnosticWorkflowStep::begin(self : DiagnosticWorkflowStep, timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflowStep::clear_attempt

fn DiagnosticWorkflowStep::clear_attempt(self : DiagnosticWorkflowStep) -> Unit

#
DiagnosticWorkflowStep::completed

fn DiagnosticWorkflowStep::completed(self : DiagnosticWorkflowStep) -> Bool

#
DiagnosticWorkflowStep::name

#
DiagnosticWorkflowStep::request

#
DiagnosticWorkflowStep::result

#
DiagnosticWorkflowStep::retry

#
DiagnosticWorkflowStep::sent_at_us

fn DiagnosticWorkflowStep::sent_at_us(self : DiagnosticWorkflowStep) -> UInt64?

#
DiagnosticWorkflowStep::timed_out

fn DiagnosticWorkflowStep::timed_out(self : DiagnosticWorkflowStep, timestamp_us : UInt64) -> Bool

#
DiagnosticWorkflowStep::timeout_us

fn DiagnosticWorkflowStep::timeout_us(self : DiagnosticWorkflowStep) -> UInt64

#
DtcQuery

pub enum DtcQuery {
AllDtc
ByCode(UInt)
ByStatusMask(Byte)
BySeverityAtLeast(Byte)
ConfirmedOnly
WarningOnly
SeenAfter(UInt64)
}

A DTC query selector.

#
DtcRecord

pub struct DtcRecord {
code : UInt
status : Byte
occurrence : UInt
snapshot : Array[Byte]
}

A normalized three-byte diagnostic trouble code.

#
DtcRecord::code

fn DtcRecord::code(self : DtcRecord) -> UInt

#
DtcRecord::occurrence

fn DtcRecord::occurrence(self : DtcRecord) -> UInt

#
DtcRecord::snapshot

fn DtcRecord::snapshot(self : DtcRecord) -> Array[Byte]

#
DtcRecord::status

fn DtcRecord::status(self : DtcRecord) -> Byte

#
DtcReport

pub struct DtcReport {
subfunction : Byte
status_availability_mask : Byte
records : Array[DtcRecord]
}

A parsed ReadDTCInformation response.

#
DtcReport::records

fn DtcReport::records(self : DtcReport) -> Array[DtcRecord]

#
DtcReport::status_availability_mask

fn DtcReport::status_availability_mask(self : DtcReport) -> Byte

#
DtcReport::subfunction

fn DtcReport::subfunction(self : DtcReport) -> Byte

#
DtcStatusBit

pub enum DtcStatusBit {
TestFailed
TestFailedThisOperationCycle
PendingDtc
ConfirmedDtc
TestNotCompletedSinceClear
TestFailedSinceClear
TestNotCompletedThisOperationCycle
WarningIndicatorRequested
}

A status bit set used by a stored diagnostic trouble code.

#
DtcStore

pub struct DtcStore {
capacity : Int
records : Array[DtcRecord]
updates : UInt
}

A bounded DTC store suitable for an ECU simulator or gateway cache.

#
DtcStore::clear_mask

fn DtcStore::clear_mask(self : DtcStore, code : UInt, mask : UInt) -> Int

Clear all records whose code matches a 24-bit mask.

#
DtcStore::find

fn DtcStore::find(self : DtcStore, code : UInt) -> DtcRecord?

#
DtcStore::length

fn DtcStore::length(self : DtcStore) -> Int

#
DtcStore::query_status

fn DtcStore::query_status(self : DtcStore, status_mask : Byte) -> Array[DtcRecord]

Query records whose status contains every bit in status_mask.

#
DtcStore::remove

fn DtcStore::remove(self : DtcStore, code : UInt) -> Bool

Remove one DTC, returning whether it existed.

#
DtcStore::snapshot

fn DtcStore::snapshot(self : DtcStore) -> Array[DtcRecord]

#
DtcStore::updates

fn DtcStore::updates(self : DtcStore) -> UInt

#
DtcStore::upsert

fn DtcStore::upsert(self : DtcStore, record : DtcRecord) -> Unit raise DtcCodecError

Add a code or update the status and occurrence count of an existing code.

#
EcuEndpoint

pub struct EcuEndpoint {
address : UInt
name : String
session : DiagnosticSessionProfile
data : DiagnosticDataTable
dtcs : DiagnosticTroubleCodeStore
memory : EcuMemoryMap
security : EcuSecurityPolicy
reset_count : Int
request_count : Int
positive_count : Int
negative_count : Int
last_timestamp_us : UInt64
pending_reset : EcuResetKind?
}

A deterministic ECU endpoint for integration testing.

#
EcuEndpoint::address

fn EcuEndpoint::address(self : EcuEndpoint) -> UInt

#
EcuEndpoint::clear_dtcs

fn EcuEndpoint::clear_dtcs(self : EcuEndpoint, timestamp_us : UInt64) -> Unit

#
EcuEndpoint::data

#
EcuEndpoint::dtcs

#
EcuEndpoint::handle

fn EcuEndpoint::handle(self : EcuEndpoint, request : DiagnosticRequest, timestamp_us : UInt64) -> EcuRequestOutcome

Handle a request and update endpoint counters.

#
EcuEndpoint::memory

fn EcuEndpoint::memory(self : EcuEndpoint) -> EcuMemoryMap

#
EcuEndpoint::name

fn EcuEndpoint::name(self : EcuEndpoint) -> String

#
EcuEndpoint::negative_count

fn EcuEndpoint::negative_count(self : EcuEndpoint) -> Int

#
EcuEndpoint::pending_reset

fn EcuEndpoint::pending_reset(self : EcuEndpoint) -> EcuResetKind?

#
EcuEndpoint::positive_count

fn EcuEndpoint::positive_count(self : EcuEndpoint) -> Int

#
EcuEndpoint::record_dtc

fn EcuEndpoint::record_dtc(self : EcuEndpoint, item : DiagnosticTroubleCode) -> Unit

#
EcuEndpoint::register_data

fn EcuEndpoint::register_data(self : EcuEndpoint, item : DiagnosticDataIdentifier) -> Bool

#
EcuEndpoint::register_memory

fn EcuEndpoint::register_memory(self : EcuEndpoint, region : EcuMemoryRegion) -> Bool

#
EcuEndpoint::request_count

fn EcuEndpoint::request_count(self : EcuEndpoint) -> Int

#
EcuEndpoint::reset_count

fn EcuEndpoint::reset_count(self : EcuEndpoint) -> Int

#
EcuEndpoint::security

fn EcuEndpoint::security(self : EcuEndpoint) -> EcuSecurityPolicy

#
EcuEndpoint::session

#
EcuEndpoint::to_text

fn EcuEndpoint::to_text(self : EcuEndpoint) -> String

Return a compact endpoint health line for a simulation report.

#
EcuFleet

pub struct EcuFleet {
endpoints : Array[EcuEndpoint]
routed : Int
missed : Int
}

A deterministic fleet of ECU endpoints.

#
EcuFleet::add

fn EcuFleet::add(self : EcuFleet, endpoint : EcuEndpoint) -> Bool

#
EcuFleet::endpoints

fn EcuFleet::endpoints(self : EcuFleet) -> Array[EcuEndpoint]

#
EcuFleet::find

fn EcuFleet::find(self : EcuFleet, address : UInt) -> EcuEndpoint?

#
EcuFleet::handle

fn EcuFleet::handle(self : EcuFleet, address : UInt, request : DiagnosticRequest, timestamp_us : UInt64) -> EcuRequestOutcome

#
EcuFleet::length

fn EcuFleet::length(self : EcuFleet) -> Int

#
EcuFleet::missed

fn EcuFleet::missed(self : EcuFleet) -> Int

#
EcuFleet::remove

fn EcuFleet::remove(self : EcuFleet, address : UInt) -> Bool

#
EcuFleet::routed

fn EcuFleet::routed(self : EcuFleet) -> Int

#
EcuFleet::to_text

fn EcuFleet::to_text(self : EcuFleet) -> String

#
EcuMemoryMap

pub struct EcuMemoryMap {
regions : Array[EcuMemoryRegion]
reads : Int
writes : Int
}

A collection of non-overlapping ECU memory regions.

#
EcuMemoryMap::add

fn EcuMemoryMap::add(self : EcuMemoryMap, region : EcuMemoryRegion) -> Unit raise EcuMemoryError

#
EcuMemoryMap::find

fn EcuMemoryMap::find(self : EcuMemoryMap, address : UInt, length : Int) -> EcuMemoryRegion?

#
EcuMemoryMap::length

fn EcuMemoryMap::length(self : EcuMemoryMap) -> Int

#
EcuMemoryMap::read

fn EcuMemoryMap::read(self : EcuMemoryMap, address : UInt, length : Int) -> Array[Byte] raise EcuMemoryError

#
EcuMemoryMap::reads

fn EcuMemoryMap::reads(self : EcuMemoryMap) -> Int

#
EcuMemoryMap::regions

#
EcuMemoryMap::write

fn EcuMemoryMap::write(self : EcuMemoryMap, address : UInt, data : Array[Byte]) -> Unit raise EcuMemoryError

#
EcuMemoryMap::writes

fn EcuMemoryMap::writes(self : EcuMemoryMap) -> Int

#
EcuMemoryPermission

pub enum EcuMemoryPermission {
EcuMemoryReadable
EcuMemoryWritable
EcuMemoryReadWrite
EcuMemoryLocked
}

Access permission for a deterministic ECU memory region.

#
EcuMemoryRegion

pub struct EcuMemoryRegion {
start : UInt
length : Int
permission : EcuMemoryPermission
bytes : Array[Byte]
}

An addressable memory region exposed by an ECU simulator.

#
EcuMemoryRegion::bytes

fn EcuMemoryRegion::bytes(self : EcuMemoryRegion) -> Array[Byte]

#
EcuMemoryRegion::contains

fn EcuMemoryRegion::contains(self : EcuMemoryRegion, address : UInt, length : Int) -> Bool

#
EcuMemoryRegion::fill

fn EcuMemoryRegion::fill(self : EcuMemoryRegion, value : Byte) -> Unit raise EcuMemoryError

#
EcuMemoryRegion::length

fn EcuMemoryRegion::length(self : EcuMemoryRegion) -> Int

#
EcuMemoryRegion::permission

#
EcuMemoryRegion::read

fn EcuMemoryRegion::read(self : EcuMemoryRegion, address : UInt, length : Int) -> Array[Byte] raise EcuMemoryError

#
EcuMemoryRegion::start

fn EcuMemoryRegion::start(self : EcuMemoryRegion) -> UInt

#
EcuMemoryRegion::write

fn EcuMemoryRegion::write(self : EcuMemoryRegion, address : UInt, data : Array[Byte]) -> Unit raise EcuMemoryError

#
EcuRequestOutcome

pub enum EcuRequestOutcome {
EcuPositiveResponse(Array[Byte])
EcuNegativeResponse(Byte)
EcuRequestRejected(String)
}

The result of handling a diagnostic request at an ECU endpoint.

#
EcuResetKind

pub enum EcuResetKind {
EcuHardReset
EcuKeyOffOnReset
EcuSoftReset
EcuResetBySupplier(Byte)
}

ECU reset kinds understood by the simulator.

#
EcuSecurityPolicy

pub struct EcuSecurityPolicy {
level : Byte
secret : UInt
max_attempts : Int
delay_us : UInt64
attempts : Int
state : EcuSecurityState
seed_counter : UInt
}

Deterministic security access policy for tests and simulation.

#
EcuSecurityPolicy::attempts

fn EcuSecurityPolicy::attempts(self : EcuSecurityPolicy) -> Int

#
EcuSecurityPolicy::expected_key

fn EcuSecurityPolicy::expected_key(self : EcuSecurityPolicy, seed : UInt) -> UInt

#
EcuSecurityPolicy::is_unlocked

fn EcuSecurityPolicy::is_unlocked(self : EcuSecurityPolicy) -> Bool

#
EcuSecurityPolicy::issue_seed

fn EcuSecurityPolicy::issue_seed(self : EcuSecurityPolicy, timestamp_us : UInt64) -> UInt

#
EcuSecurityPolicy::level

fn EcuSecurityPolicy::level(self : EcuSecurityPolicy) -> Byte

#
EcuSecurityPolicy::lock

fn EcuSecurityPolicy::lock(self : EcuSecurityPolicy) -> Unit

#
EcuSecurityPolicy::state

#
EcuSecurityPolicy::unlock

fn EcuSecurityPolicy::unlock(self : EcuSecurityPolicy, key : UInt, seed : UInt, timestamp_us : UInt64) -> Bool

#
EcuSecurityState

pub enum EcuSecurityState {
EcuSecurityLocked
EcuSecuritySeedIssued(Byte)
EcuSecurityUnlocked(Byte)
EcuSecurityDelay(UInt64)
}

Security access state maintained by an ECU endpoint.

#
Filter

pub struct Filter {
id : UInt
mask : UInt
extended : Bool?
}

A CAN acceptance filter.

#
Filter::extended

fn Filter::extended(self : Filter) -> Bool?

#
Filter::id

fn Filter::id(self : Filter) -> UInt

Return a filter's identifier pattern.

#
Filter::mask

fn Filter::mask(self : Filter) -> UInt

#
Filter::matches

fn Filter::matches(self : Filter, frame : Frame) -> Bool

Return whether a frame passes this filter.

#
FilterBank

pub struct FilterBank {
filters : Array[Filter]
}

A group of filters evaluated in insertion order.

#
FilterBank::accepts

fn FilterBank::accepts(self : FilterBank, frame : Frame) -> Bool

Test whether any filter accepts a frame. An empty bank rejects all frames.

#
FilterBank::add

fn FilterBank::add(self : FilterBank, filter : Filter) -> Unit

Add a filter to the bank.

#
FilterBank::filters

fn FilterBank::filters(self : FilterBank) -> Array[Filter]

#
FilterBank::length

fn FilterBank::length(self : FilterBank) -> Int

#
FilterIndex

pub struct FilterIndex {
bank : FilterBank
accepted : Int
rejected : Int
}

A compact exact-or-mask index for a monitoring application.

#
FilterIndex::accepted

fn FilterIndex::accepted(self : FilterIndex) -> Int

#
FilterIndex::check

fn FilterIndex::check(self : FilterIndex, frame : Frame) -> Bool

#
FilterIndex::rejected

fn FilterIndex::rejected(self : FilterIndex) -> Int

#
Frame

pub struct Frame {
id : UInt
extended : Bool
kind : FrameKind
protocol : Protocol
bitrate_switch : Bool
error_state_indicator : Bool
data : Array[Byte]
}

A normalized CAN frame.

#
Frame::bitrate_switch

fn Frame::bitrate_switch(self : Frame) -> Bool

Return whether the CAN-FD bit-rate switch is set.

#
Frame::data

fn Frame::data(self : Frame) -> Array[Byte]

Return a defensive copy of the payload.

#
Frame::dlc

fn Frame::dlc(self : Frame) -> Byte

Return the data length code for this frame.

#
Frame::error_state_indicator

fn Frame::error_state_indicator(self : Frame) -> Bool

Return whether the CAN-FD error-state indicator is set.

#
Frame::id

fn Frame::id(self : Frame) -> UInt

The arbitration identifier.

#
Frame::is_data

fn Frame::is_data(self : Frame) -> Bool

Return whether this frame carries application data.

#
Frame::is_error

fn Frame::is_error(self : Frame) -> Bool

Return whether this frame is a local simulation error.

#
Frame::is_extended

fn Frame::is_extended(self : Frame) -> Bool

Whether the frame uses the 29-bit identifier format.

#
Frame::is_remote

fn Frame::is_remote(self : Frame) -> Bool

Return whether this frame is a remote request.

#
Frame::kind

fn Frame::kind(self : Frame) -> FrameKind

Return the frame kind.

#
Frame::protocol

fn Frame::protocol(self : Frame) -> Protocol

Return the protocol version.

#
FrameAnalysis

pub struct FrameAnalysis {
unique_ids : Int
changed_payloads : Int
repeated_payloads : Int
average_payload : Double
minimum_gap_us : UInt64?
maximum_gap_us : UInt64?
}

A compact analysis of identifier and payload behavior.

#
FrameAnalysis::average_payload

fn FrameAnalysis::average_payload(self : FrameAnalysis) -> Double

#
FrameAnalysis::changed_payloads

fn FrameAnalysis::changed_payloads(self : FrameAnalysis) -> Int

#
FrameAnalysis::maximum_gap

fn FrameAnalysis::maximum_gap(self : FrameAnalysis) -> UInt64?

#
FrameAnalysis::minimum_gap

fn FrameAnalysis::minimum_gap(self : FrameAnalysis) -> UInt64?

#
FrameAnalysis::repeated_payloads

fn FrameAnalysis::repeated_payloads(self : FrameAnalysis) -> Int

#
FrameAnalysis::to_text

fn FrameAnalysis::to_text(self : FrameAnalysis) -> String

#
FrameAnalysis::unique_ids

fn FrameAnalysis::unique_ids(self : FrameAnalysis) -> Int

#
FrameBatch

pub struct FrameBatch {
sequence : UInt
frames : Array[Frame]
}

A validated batch of frames with a caller-provided sequence number.

#
FrameBatch::checksum

fn FrameBatch::checksum(self : FrameBatch) -> Byte

Return a non-cryptographic checksum suitable for corruption detection.

#
FrameBatch::encode

fn FrameBatch::encode(self : FrameBatch) -> Array[Byte]

Encode a batch as a length-prefixed binary archive.

#
FrameBatch::frames

fn FrameBatch::frames(self : FrameBatch) -> Array[Frame]

#
FrameBatch::length

fn FrameBatch::length(self : FrameBatch) -> Int

#
FrameBatch::payload_bytes

fn FrameBatch::payload_bytes(self : FrameBatch) -> Int

Return the sum of payload bytes in the batch.

#
FrameBatch::sequence

fn FrameBatch::sequence(self : FrameBatch) -> UInt

#
FrameClass

pub enum FrameClass {
ClassicData
ClassicRemote
CanFdData
SimulationError
}

A coarse frame class useful for metrics and routing policies.

#
FrameDeduplicator

pub struct FrameDeduplicator {
last : Array[(UInt, Array[Byte])]
window_us : UInt64
duplicates : Int
unique : Int
}

A duplicate detector for cyclic frames.

#
FrameDeduplicator::accept

fn FrameDeduplicator::accept(self : FrameDeduplicator, timestamp_us : UInt64, frame : Frame) -> Bool

#
FrameDeduplicator::duplicates

fn FrameDeduplicator::duplicates(self : FrameDeduplicator) -> Int

#
FrameDeduplicator::reset

fn FrameDeduplicator::reset(self : FrameDeduplicator) -> Unit

#
FrameDeduplicator::unique

fn FrameDeduplicator::unique(self : FrameDeduplicator) -> Int

#
FrameKind

pub enum FrameKind {
Data
Remote
Error
}

A CAN frame kind.

#
FrameMetrics

pub struct FrameMetrics {
total : Int
classic_data : Int
classic_remote : Int
can_fd : Int
errors : Int
extended : Int
payload_bytes : Int
wire_bits : Int
minimum_id : UInt?
maximum_id : UInt?
identifiers : Array[UInt]
payload_histogram : Array[Int]
}

Aggregate counters for a collection of CAN frames.

#
FrameMetrics::can_fd

fn FrameMetrics::can_fd(self : FrameMetrics) -> Int

#
FrameMetrics::classic_data

fn FrameMetrics::classic_data(self : FrameMetrics) -> Int

#
FrameMetrics::classic_remote

fn FrameMetrics::classic_remote(self : FrameMetrics) -> Int

#
FrameMetrics::errors

fn FrameMetrics::errors(self : FrameMetrics) -> Int

#
FrameMetrics::extended

fn FrameMetrics::extended(self : FrameMetrics) -> Int

#
FrameMetrics::identifiers

fn FrameMetrics::identifiers(self : FrameMetrics) -> Array[UInt]

#
FrameMetrics::maximum_id

fn FrameMetrics::maximum_id(self : FrameMetrics) -> UInt?

#
FrameMetrics::minimum_id

fn FrameMetrics::minimum_id(self : FrameMetrics) -> UInt?

#
FrameMetrics::payload_bytes

fn FrameMetrics::payload_bytes(self : FrameMetrics) -> Int

#
FrameMetrics::payload_count

fn FrameMetrics::payload_count(self : FrameMetrics, length : Int) -> Int

#
FrameMetrics::to_text

fn FrameMetrics::to_text(self : FrameMetrics) -> String

Render a stable metrics report for a CLI or CI artifact.

#
FrameMetrics::total

fn FrameMetrics::total(self : FrameMetrics) -> Int

#
FrameMetrics::wire_bits

fn FrameMetrics::wire_bits(self : FrameMetrics) -> Int

#
FramePipeline

pub struct FramePipeline {
rules : Array[FramePipelineRule]
capacity : Int
processed : Int
accepted : Int
rejected : Int
unmatched : Int
failures : Int
}

A deterministic ordered frame-processing pipeline.

#
FramePipeline::accepted

fn FramePipeline::accepted(self : FramePipeline) -> Int

#
FramePipeline::add_rule

fn FramePipeline::add_rule(self : FramePipeline, rule : FramePipelineRule) -> Unit raise FramePipelineError

#
FramePipeline::failures

fn FramePipeline::failures(self : FramePipeline) -> Int

#
FramePipeline::find

fn FramePipeline::find(self : FramePipeline, name : String) -> FramePipelineRule?

#
FramePipeline::process

fn FramePipeline::process(self : FramePipeline, frame : Frame) -> FramePipelineResult

#
FramePipeline::process_batch

fn FramePipeline::process_batch(self : FramePipeline, frames : Array[Frame]) -> Array[Frame]

#
FramePipeline::processed

fn FramePipeline::processed(self : FramePipeline) -> Int

#
FramePipeline::rejected

fn FramePipeline::rejected(self : FramePipeline) -> Int

#
FramePipeline::remove_rule

fn FramePipeline::remove_rule(self : FramePipeline, name : String) -> Unit raise FramePipelineError

#
FramePipeline::reset_counters

fn FramePipeline::reset_counters(self : FramePipeline) -> Unit

#
FramePipeline::rules

#
FramePipeline::to_text

fn FramePipeline::to_text(self : FramePipeline) -> String

#
FramePipeline::unmatched

fn FramePipeline::unmatched(self : FramePipeline) -> Int

#
FramePipelineAction

pub(all) enum FramePipelineAction {
FramePipelineForward
FramePipelineDrop(String)
FramePipelineRewriteId(UInt)
FramePipelinePrefix(Array[Byte])
FramePipelineReplaceData(Array[Byte])
}

Action applied by a deterministic frame-processing rule.

#
FramePipelineResult

pub(all) enum FramePipelineResult {
FramePipelineAccepted(Frame, String)
FramePipelineRejected(String)
FramePipelineUnmatched(Frame)
}

Result emitted by one pipeline invocation.

#
FramePipelineRule

pub struct FramePipelineRule {
name : String
filter : Filter
action : FramePipelineAction
max_payload : Int
allow_fd : Bool
enabled : Bool
hits : Int
}

A named frame-processing rule.

#
FramePipelineRule::action

#
FramePipelineRule::allow_fd

fn FramePipelineRule::allow_fd(self : FramePipelineRule) -> Bool

#
FramePipelineRule::enabled

fn FramePipelineRule::enabled(self : FramePipelineRule) -> Bool

#
FramePipelineRule::filter

#
FramePipelineRule::hits

fn FramePipelineRule::hits(self : FramePipelineRule) -> Int

#
FramePipelineRule::matches

fn FramePipelineRule::matches(self : FramePipelineRule, frame : Frame) -> Bool

#
FramePipelineRule::max_payload

fn FramePipelineRule::max_payload(self : FramePipelineRule) -> Int

#
FramePipelineRule::name

fn FramePipelineRule::name(self : FramePipelineRule) -> String

#
FramePipelineRule::set_enabled

fn FramePipelineRule::set_enabled(self : FramePipelineRule, enabled : Bool) -> Unit

#
FramePipelineWindow

pub struct FramePipelineWindow {
start_us : UInt64?
duration_us : UInt64
frames : Array[Frame]
closed : Bool
}

A rolling batch window for aggregating frames before analysis.

#
FramePipelineWindow::close

fn FramePipelineWindow::close(self : FramePipelineWindow) -> Unit

#
FramePipelineWindow::closed

fn FramePipelineWindow::closed(self : FramePipelineWindow) -> Bool

#
FramePipelineWindow::duration_us

fn FramePipelineWindow::duration_us(self : FramePipelineWindow) -> UInt64

#
FramePipelineWindow::frames

#
FramePipelineWindow::length

fn FramePipelineWindow::length(self : FramePipelineWindow) -> Int

#
FramePipelineWindow::metrics

#
FramePipelineWindow::push

fn FramePipelineWindow::push(self : FramePipelineWindow, timestamp_us : UInt64, frame : Frame) -> Bool

#
FramePipelineWindow::start_us

fn FramePipelineWindow::start_us(self : FramePipelineWindow) -> UInt64?

#
FrameQueue

pub struct FrameQueue {
capacity : Int
next_sequence : UInt
items : Array[QueueItem]
dropped : Int
}

A deterministic priority queue for CAN transmit pipelines.

#
FrameQueue::capacity

fn FrameQueue::capacity(self : FrameQueue) -> Int

#
FrameQueue::clear

fn FrameQueue::clear(self : FrameQueue) -> Unit

Remove every pending item.

#
FrameQueue::dequeue

fn FrameQueue::dequeue(self : FrameQueue) -> QueueItem raise QueueError

Remove the highest-priority item.

#
FrameQueue::dropped

fn FrameQueue::dropped(self : FrameQueue) -> Int

#
FrameQueue::enqueue

fn FrameQueue::enqueue(self : FrameQueue, channel : Byte, frame : Frame, enqueued_us : UInt64, deadline_us : UInt64) -> UInt raise QueueError

Add a frame and return its monotonic sequence number.

#
FrameQueue::expire

fn FrameQueue::expire(self : FrameQueue, now_us : UInt64) -> Array[QueueItem]

Remove items whose deadline has expired at now_us.

#
FrameQueue::is_empty

fn FrameQueue::is_empty(self : FrameQueue) -> Bool

#
FrameQueue::is_full

fn FrameQueue::is_full(self : FrameQueue) -> Bool

#
FrameQueue::length

fn FrameQueue::length(self : FrameQueue) -> Int

#
FrameQueue::peek

fn FrameQueue::peek(self : FrameQueue) -> QueueItem?

Return the highest-priority item without removing it.

#
FrameQueue::remove

fn FrameQueue::remove(self : FrameQueue, sequence : UInt) -> QueueItem raise QueueError

Remove a particular sequence number.

#
FrameQueue::snapshot

fn FrameQueue::snapshot(self : FrameQueue) -> Array[QueueItem]

#
FrameQueue::take_channel

fn FrameQueue::take_channel(self : FrameQueue, channel : Byte, limit : Int) -> Array[QueueItem] raise QueueError

Take up to limit items for one logical channel.

#
FrameRateLimiter

pub struct FrameRateLimiter {
intervals : Array[(UInt, UInt64)]
last_sent : Array[(UInt, UInt64)]
allowed : Int
limited : Int
}

A simple per-identifier rate limiter.

#
FrameRateLimiter::allow

fn FrameRateLimiter::allow(self : FrameRateLimiter, identifier : UInt, timestamp_us : UInt64) -> Bool

#
FrameRateLimiter::allowed

fn FrameRateLimiter::allowed(self : FrameRateLimiter) -> Int

#
FrameRateLimiter::limited

fn FrameRateLimiter::limited(self : FrameRateLimiter) -> Int

#
FrameRateLimiter::reset

fn FrameRateLimiter::reset(self : FrameRateLimiter) -> Unit

#
FrameRateLimiter::set_interval

fn FrameRateLimiter::set_interval(self : FrameRateLimiter, identifier : UInt, interval_us : UInt64) -> Unit

#
FrameReport

pub struct FrameReport {
valid : Bool
violations : Array[FrameViolation]
wire_bits : Int
stuffed_bits : Int
}

The result of validating a normalized frame.

#
FrameReport::is_valid

fn FrameReport::is_valid(self : FrameReport) -> Bool

#
FrameReport::stuffed_bits

fn FrameReport::stuffed_bits(self : FrameReport) -> Int

#
FrameReport::violations

fn FrameReport::violations(self : FrameReport) -> Array[FrameViolation]

#
FrameReport::wire_bits

fn FrameReport::wire_bits(self : FrameReport) -> Int

#
FrameViolation

pub enum FrameViolation {
IdentifierRange
ClassicPayloadRange
FdPayloadRange
RemoteCarriesData
FdControlOnClassic
InvalidErrorShape
NonCanonicalDlc
} derive(
Debug
)

A concrete validation finding.

#
GatewayPair

pub struct GatewayPair {
left_to_right : CanGateway
right_to_left : CanGateway
}

Create a bidirectional bridge from two gateways.

#
GatewayPair::left

fn GatewayPair::left(self : GatewayPair) -> CanGateway

#
GatewayPair::right

fn GatewayPair::right(self : GatewayPair) -> CanGateway

#
GatewayPolicyAudit

pub struct GatewayPolicyAudit {
timestamp_us : UInt64
rule_name : String
source_channel : String
destination_channel : String
decision : GatewayPolicyDecision
input_id : UInt
output_id : UInt?
}

An immutable audit record produced by the policy engine.

#
GatewayPolicyAudit::decision

#
GatewayPolicyAudit::destination_channel

fn GatewayPolicyAudit::destination_channel(self : GatewayPolicyAudit) -> String

#
GatewayPolicyAudit::input_id

fn GatewayPolicyAudit::input_id(self : GatewayPolicyAudit) -> UInt

#
GatewayPolicyAudit::output_id

fn GatewayPolicyAudit::output_id(self : GatewayPolicyAudit) -> UInt?

#
GatewayPolicyAudit::rule_name

fn GatewayPolicyAudit::rule_name(self : GatewayPolicyAudit) -> String

#
GatewayPolicyAudit::source_channel

fn GatewayPolicyAudit::source_channel(self : GatewayPolicyAudit) -> String

#
GatewayPolicyAudit::timestamp_us

fn GatewayPolicyAudit::timestamp_us(self : GatewayPolicyAudit) -> UInt64

#
GatewayPolicyContext

pub struct GatewayPolicyContext {
timestamp_us : UInt64
source_channel : String
destination_channel : String
frame : Frame
}

A policy evaluation context used for audit and rate limiting.

#
GatewayPolicyContext::destination_channel

fn GatewayPolicyContext::destination_channel(self : GatewayPolicyContext) -> String

#
GatewayPolicyContext::frame

#
GatewayPolicyContext::source_channel

fn GatewayPolicyContext::source_channel(self : GatewayPolicyContext) -> String

#
GatewayPolicyContext::timestamp_us

fn GatewayPolicyContext::timestamp_us(self : GatewayPolicyContext) -> UInt64

#
GatewayPolicyDecision

pub enum GatewayPolicyDecision {
GatewayPolicyAllow
GatewayPolicyDeny(String)
GatewayPolicyRewrite(Frame)
GatewayPolicyRateLimited
}

Result of evaluating a gateway policy.

#
GatewayPolicyEngine

pub struct GatewayPolicyEngine {
rules : Array[GatewayPolicyRule]
audits : Array[GatewayPolicyAudit]
capacity : Int
evaluated : Int
allowed : Int
denied : Int
rewritten : Int
rate_limited : Int
}

An ordered, rate-limited gateway policy engine.

#
GatewayPolicyEngine::add_rule

fn GatewayPolicyEngine::add_rule(self : GatewayPolicyEngine, rule : GatewayPolicyRule) -> Bool

#
GatewayPolicyEngine::allowed

fn GatewayPolicyEngine::allowed(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::audit_count

fn GatewayPolicyEngine::audit_count(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::audits

#
GatewayPolicyEngine::denied

fn GatewayPolicyEngine::denied(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::evaluate

#
GatewayPolicyEngine::evaluated

fn GatewayPolicyEngine::evaluated(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::find

fn GatewayPolicyEngine::find(self : GatewayPolicyEngine, name : String) -> GatewayPolicyRule?

#
GatewayPolicyEngine::forward

#
GatewayPolicyEngine::rate_limited

fn GatewayPolicyEngine::rate_limited(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::remove_rule

fn GatewayPolicyEngine::remove_rule(self : GatewayPolicyEngine, name : String) -> Bool

#
GatewayPolicyEngine::reset

fn GatewayPolicyEngine::reset(self : GatewayPolicyEngine) -> Unit

#
GatewayPolicyEngine::rewritten

fn GatewayPolicyEngine::rewritten(self : GatewayPolicyEngine) -> Int

#
GatewayPolicyEngine::rules

#
GatewayPolicyEngine::to_text

fn GatewayPolicyEngine::to_text(self : GatewayPolicyEngine) -> String

#
GatewayPolicyRule

pub struct GatewayPolicyRule {
name : String
filter : Filter
output_id : UInt?
prefix : Array[Byte]
max_payload : Int
min_interval_us : UInt64
allow_remote : Bool
enabled : Bool
hits : Int
denied : Int
last_timestamp_us : UInt64?
}

A policy rule for a gateway direction.

#
GatewayPolicyRule::allow_remote

fn GatewayPolicyRule::allow_remote(self : GatewayPolicyRule) -> Bool

#
GatewayPolicyRule::denied

fn GatewayPolicyRule::denied(self : GatewayPolicyRule) -> Int

#
GatewayPolicyRule::enabled

fn GatewayPolicyRule::enabled(self : GatewayPolicyRule) -> Bool

#
GatewayPolicyRule::filter

#
GatewayPolicyRule::hits

fn GatewayPolicyRule::hits(self : GatewayPolicyRule) -> Int

#
GatewayPolicyRule::matches

fn GatewayPolicyRule::matches(self : GatewayPolicyRule, frame : Frame) -> Bool

#
GatewayPolicyRule::max_payload

fn GatewayPolicyRule::max_payload(self : GatewayPolicyRule) -> Int

#
GatewayPolicyRule::min_interval_us

fn GatewayPolicyRule::min_interval_us(self : GatewayPolicyRule) -> UInt64

#
GatewayPolicyRule::name

fn GatewayPolicyRule::name(self : GatewayPolicyRule) -> String

#
GatewayPolicyRule::output_id

fn GatewayPolicyRule::output_id(self : GatewayPolicyRule) -> UInt?

#
GatewayPolicyRule::prefix

fn GatewayPolicyRule::prefix(self : GatewayPolicyRule) -> Array[Byte]

#
GatewayPolicyRule::rewrite

fn GatewayPolicyRule::rewrite(self : GatewayPolicyRule, frame : Frame) -> Frame raise FrameError

Apply the rewrite portion of a gateway policy rule.

#
GatewayPolicyRule::set_enabled

fn GatewayPolicyRule::set_enabled(self : GatewayPolicyRule, enabled : Bool) -> Unit

#
IsoTpChannel

pub struct IsoTpChannel {
source_id : UInt
target_id : UInt
extended : Bool
addressing : IsoTpSessionAddressing
flow_control : IsoTpFlowControlConfig
}

An ISO-TP channel identity used by a transport router.

#
IsoTpChannel::accepts

fn IsoTpChannel::accepts(self : IsoTpChannel, frame : Frame) -> Bool

Return whether a frame identifier belongs to a channel.

#
IsoTpChannel::addressing

#
IsoTpChannel::extended

fn IsoTpChannel::extended(self : IsoTpChannel) -> Bool

#
IsoTpChannel::flow_control

#
IsoTpChannel::frame

fn IsoTpChannel::frame(self : IsoTpChannel, payload : Array[Byte], transmit : Bool) -> Frame raise FrameError

Build a CAN frame carrying an ISO-TP payload.

#
IsoTpChannel::source_id

fn IsoTpChannel::source_id(self : IsoTpChannel) -> UInt

#
IsoTpChannel::target_id

fn IsoTpChannel::target_id(self : IsoTpChannel) -> UInt

#
IsoTpConfig

pub struct IsoTpConfig {
frame_bytes : Int
block_size : Byte
separation_time : Byte
}

ISO-TP transfer parameters for classic CAN and CAN-FD.

#
IsoTpConfig::block_size

fn IsoTpConfig::block_size(self : IsoTpConfig) -> Byte

#
IsoTpConfig::frame_bytes

fn IsoTpConfig::frame_bytes(self : IsoTpConfig) -> Int

#
IsoTpConfig::separation_time

fn IsoTpConfig::separation_time(self : IsoTpConfig) -> Byte

#
IsoTpFlowControlConfig

pub struct IsoTpFlowControlConfig {
block_size : Int
separation_time_us : UInt64
wait_frame_limit : Int
max_payload : Int
}

Flow-control parameters advertised by a receiver.

#
IsoTpFlowControlConfig::block_size

fn IsoTpFlowControlConfig::block_size(self : IsoTpFlowControlConfig) -> Int

#
IsoTpFlowControlConfig::max_payload

fn IsoTpFlowControlConfig::max_payload(self : IsoTpFlowControlConfig) -> Int

#
IsoTpFlowControlConfig::separation_time_us

fn IsoTpFlowControlConfig::separation_time_us(self : IsoTpFlowControlConfig) -> UInt64

#
IsoTpFlowControlConfig::to_payload

fn IsoTpFlowControlConfig::to_payload(self : IsoTpFlowControlConfig) -> Array[Byte]

Return the wire representation of a flow-control frame.

#
IsoTpFlowControlConfig::wait_frame_limit

fn IsoTpFlowControlConfig::wait_frame_limit(self : IsoTpFlowControlConfig) -> Int

#
IsoTpPacket

pub enum IsoTpPacket {
Single(payload~ : Array[Byte])
First(total_length~ : Int, payload~ : Array[Byte])
Consecutive(sequence~ : Byte, payload~ : Array[Byte])
FlowControl(status~ : Byte, block_size~ : Byte, separation_time~ : Byte)
}

A decoded ISO-TP packet.

#
IsoTpReceiver

pub struct IsoTpReceiver {
config : IsoTpConfig
total_length : Int
payload : Array[Byte]
next_sequence : Byte
block_count : Int
}

An incremental ISO-TP receiver for a single outstanding transfer.

#
IsoTpReceiver::flow_control

fn IsoTpReceiver::flow_control(self : IsoTpReceiver) -> Array[Byte]

Return a flow-control packet for this receiver's configured limits.

#
IsoTpReceiver::push

fn IsoTpReceiver::push(self : IsoTpReceiver, packet : IsoTpPacket) -> IsoTpStatus raise IsoTpError

Feed one decoded packet into the receiver.

#
IsoTpReceiver::reset

fn IsoTpReceiver::reset(self : IsoTpReceiver) -> Unit

Clear the current transfer.

#
IsoTpReceiverResult

pub enum IsoTpReceiverResult {
IsoTpRxIgnored
IsoTpRxFlowControl(Array[Byte])
IsoTpRxProgress(Int)
IsoTpRxComplete(Array[Byte])
IsoTpRxError(String)
}

A receiver result for an incoming ISO-TP payload.

#
IsoTpRouter

pub struct IsoTpRouter {
channels : Array[IsoTpChannel]
accepted : Int
rejected : Int
}

A bounded transport router for multiple diagnostic channels.

#
IsoTpRouter::accepted

fn IsoTpRouter::accepted(self : IsoTpRouter) -> Int

#
IsoTpRouter::add_channel

fn IsoTpRouter::add_channel(self : IsoTpRouter, channel : IsoTpChannel) -> Bool

#
IsoTpRouter::channels

fn IsoTpRouter::channels(self : IsoTpRouter) -> Array[IsoTpChannel]

#
IsoTpRouter::find_channel

fn IsoTpRouter::find_channel(self : IsoTpRouter, source_id : UInt, target_id : UInt) -> IsoTpChannel?

#
IsoTpRouter::rejected

fn IsoTpRouter::rejected(self : IsoTpRouter) -> Int

#
IsoTpRouter::remove_channel

fn IsoTpRouter::remove_channel(self : IsoTpRouter, source_id : UInt, target_id : UInt) -> Bool

#
IsoTpRouter::route

fn IsoTpRouter::route(self : IsoTpRouter, frame : Frame) -> IsoTpChannel?

#
IsoTpSession

pub struct IsoTpSession {
transmitter : IsoTpTransmitter?
receiver : IsoTpStreamReceiver
sent_frames : Int
received_frames : Int
dropped_frames : Int
}

A transport exchange combining a transmitter and receiver.

#
IsoTpSession::accept_flow_control

fn IsoTpSession::accept_flow_control(self : IsoTpSession, payload : Array[Byte], timestamp_us : UInt64) -> Bool

#
IsoTpSession::dropped_frames

fn IsoTpSession::dropped_frames(self : IsoTpSession) -> Int

#
IsoTpSession::next_transmit

fn IsoTpSession::next_transmit(self : IsoTpSession, timestamp_us : UInt64) -> Array[Byte]?

#
IsoTpSession::receive

fn IsoTpSession::receive(self : IsoTpSession, payload : Array[Byte], timestamp_us : UInt64) -> IsoTpReceiverResult

#
IsoTpSession::received_frames

fn IsoTpSession::received_frames(self : IsoTpSession) -> Int

#
IsoTpSession::receiver

#
IsoTpSession::sent_frames

fn IsoTpSession::sent_frames(self : IsoTpSession) -> Int

#
IsoTpSession::start_transmit

fn IsoTpSession::start_transmit(self : IsoTpSession, payload : Array[Byte], timestamp_us : UInt64) -> Unit

#
IsoTpSession::transmitter

fn IsoTpSession::transmitter(self : IsoTpSession) -> IsoTpTransmitter?

#
IsoTpSessionAddressing

pub enum IsoTpSessionAddressing {
IsoTpNormalAddressing
IsoTpExtendedAddressing(Byte)
IsoTpMixedAddressing(Byte)
}

ISO-TP addressing format for a diagnostic transport channel.

#
IsoTpStatus

pub enum IsoTpStatus {
Waiting(received~ : Int, total~ : Int)
Complete(payload~ : Array[Byte])
}

The state of an incremental receiver.

#
IsoTpStreamReceiver

pub struct IsoTpStreamReceiver {
expected_length : Int
received : Array[Byte]
next_sequence : Byte
block_received : Int
wait_frames : Int
last_timestamp_us : UInt64
active : Bool
complete : Bool
flow_control : IsoTpFlowControlConfig
timeout_us : UInt64
}

A stateful ISO-TP receiver.

#
IsoTpStreamReceiver::active

fn IsoTpStreamReceiver::active(self : IsoTpStreamReceiver) -> Bool

#
IsoTpStreamReceiver::complete

fn IsoTpStreamReceiver::complete(self : IsoTpStreamReceiver) -> Bool

#
IsoTpStreamReceiver::expected_length

fn IsoTpStreamReceiver::expected_length(self : IsoTpStreamReceiver) -> Int

#
IsoTpStreamReceiver::feed

fn IsoTpStreamReceiver::feed(self : IsoTpStreamReceiver, payload : Array[Byte], timestamp_us : UInt64) -> IsoTpReceiverResult

Feed a complete ISO-TP payload received from the bus.

#
IsoTpStreamReceiver::last_timestamp_us

fn IsoTpStreamReceiver::last_timestamp_us(self : IsoTpStreamReceiver) -> UInt64

#
IsoTpStreamReceiver::next_sequence

fn IsoTpStreamReceiver::next_sequence(self : IsoTpStreamReceiver) -> Byte

#
IsoTpStreamReceiver::payload

fn IsoTpStreamReceiver::payload(self : IsoTpStreamReceiver) -> Array[Byte]

#
IsoTpStreamReceiver::received_length

fn IsoTpStreamReceiver::received_length(self : IsoTpStreamReceiver) -> Int

#
IsoTpStreamReceiver::remaining

fn IsoTpStreamReceiver::remaining(self : IsoTpStreamReceiver) -> Int

#
IsoTpStreamReceiver::reset

fn IsoTpStreamReceiver::reset(self : IsoTpStreamReceiver) -> Unit

Reset a receiver to accept a new transfer.

#
IsoTpStreamReceiver::take_payload

fn IsoTpStreamReceiver::take_payload(self : IsoTpStreamReceiver) -> Array[Byte]?

Take the completed payload and reset the receiver.

#
IsoTpStreamReceiver::timed_out

fn IsoTpStreamReceiver::timed_out(self : IsoTpStreamReceiver, timestamp_us : UInt64) -> Bool

Return whether a receiver transfer has timed out.

#
IsoTpTransmitter

pub struct IsoTpTransmitter {
payload : Array[Byte]
offset : Int
sequence : Byte
block_sent : Int
wait_frames : Int
state : IsoTpTransmitterState
flow_control : IsoTpFlowControlConfig
next_due_us : UInt64
started_us : UInt64
}

A stateful ISO-TP transmitter.

#
IsoTpTransmitter::abort

fn IsoTpTransmitter::abort(self : IsoTpTransmitter, reason : String) -> Unit

Abort a transmitter with a stable reason.

#
IsoTpTransmitter::accept_flow_control

fn IsoTpTransmitter::accept_flow_control(self : IsoTpTransmitter, payload : Array[Byte], timestamp_us : UInt64) -> Bool

Accept a receiver flow-control payload.

#
IsoTpTransmitter::estimated_finish_us

fn IsoTpTransmitter::estimated_finish_us(self : IsoTpTransmitter) -> UInt64

Return an upper bound for the remaining transfer duration.

#
IsoTpTransmitter::is_aborted

fn IsoTpTransmitter::is_aborted(self : IsoTpTransmitter) -> Bool

#
IsoTpTransmitter::is_complete

fn IsoTpTransmitter::is_complete(self : IsoTpTransmitter) -> Bool

#
IsoTpTransmitter::next_due_us

fn IsoTpTransmitter::next_due_us(self : IsoTpTransmitter) -> UInt64

#
IsoTpTransmitter::next_payload

fn IsoTpTransmitter::next_payload(self : IsoTpTransmitter, timestamp_us : UInt64) -> Array[Byte]?

Produce the next ISO-TP payload when the transmitter is due.

#
IsoTpTransmitter::offset

fn IsoTpTransmitter::offset(self : IsoTpTransmitter) -> Int

#
IsoTpTransmitter::payload

fn IsoTpTransmitter::payload(self : IsoTpTransmitter) -> Array[Byte]

#
IsoTpTransmitter::remaining

fn IsoTpTransmitter::remaining(self : IsoTpTransmitter) -> Int

#
IsoTpTransmitter::sequence

fn IsoTpTransmitter::sequence(self : IsoTpTransmitter) -> Byte

#
IsoTpTransmitter::started_us

fn IsoTpTransmitter::started_us(self : IsoTpTransmitter) -> UInt64

#
IsoTpTransmitter::state

#
IsoTpTransmitterState

pub enum IsoTpTransmitterState {
IsoTpTxIdle
IsoTpTxWaitingFlowControl
IsoTpTxSending
IsoTpTxComplete
IsoTpTxAborted(String)
}

State of a long-payload ISO-TP transmitter.

#
J1939AddressClaim

pub struct J1939AddressClaim {
source_address : Byte
name : UInt64
manufacturer : UInt
function : Byte
instance : Byte
last_seen_us : UInt64
preferred : Bool
}

A J1939 address-claim record.

#
J1939AddressClaim::function

fn J1939AddressClaim::function(self : J1939AddressClaim) -> Byte

#
J1939AddressClaim::instance

fn J1939AddressClaim::instance(self : J1939AddressClaim) -> Byte

#
J1939AddressClaim::last_seen_us

fn J1939AddressClaim::last_seen_us(self : J1939AddressClaim) -> UInt64

#
J1939AddressClaim::manufacturer

fn J1939AddressClaim::manufacturer(self : J1939AddressClaim) -> UInt

#
J1939AddressClaim::name

fn J1939AddressClaim::name(self : J1939AddressClaim) -> UInt64

#
J1939AddressClaim::preferred

fn J1939AddressClaim::preferred(self : J1939AddressClaim) -> Bool

#
J1939AddressClaim::refresh

fn J1939AddressClaim::refresh(self : J1939AddressClaim, timestamp_us : UInt64) -> Unit

#
J1939AddressClaim::set_preferred

fn J1939AddressClaim::set_preferred(self : J1939AddressClaim, preferred : Bool) -> Unit

#
J1939AddressClaim::source_address

fn J1939AddressClaim::source_address(self : J1939AddressClaim) -> Byte

#
J1939AddressClaim::wire_name

fn J1939AddressClaim::wire_name(self : J1939AddressClaim) -> Array[Byte]

#
J1939AddressManager

pub struct J1939AddressManager {
claims : Array[J1939AddressClaim]
conflicts : Int
changes : Int
timeout_us : UInt64
}

Address-claim table with deterministic conflict resolution.

#
J1939AddressManager::changes

fn J1939AddressManager::changes(self : J1939AddressManager) -> Int

#
J1939AddressManager::claim

fn J1939AddressManager::claim(self : J1939AddressManager, claim : J1939AddressClaim) -> Bool

#
J1939AddressManager::claims

#
J1939AddressManager::conflicts

fn J1939AddressManager::conflicts(self : J1939AddressManager) -> Int

#
J1939AddressManager::expire

fn J1939AddressManager::expire(self : J1939AddressManager, timestamp_us : UInt64) -> Int

#
J1939AddressManager::find

fn J1939AddressManager::find(self : J1939AddressManager, source_address : Byte) -> J1939AddressClaim?

#
J1939AddressManager::refresh

fn J1939AddressManager::refresh(self : J1939AddressManager, source_address : Byte, timestamp_us : UInt64) -> Bool

#
J1939Id

pub struct J1939Id {
priority : Byte
data_page : Bool
pdu_format : Byte
pdu_specific : Byte
source_address : Byte
}

A decoded 29-bit J1939 identifier.

#
J1939Id::data_page

fn J1939Id::data_page(self : J1939Id) -> Bool

#
J1939Id::destination

fn J1939Id::destination(self : J1939Id) -> Byte?

#
J1939Id::pdu_format

fn J1939Id::pdu_format(self : J1939Id) -> Byte

#
J1939Id::pdu_specific

fn J1939Id::pdu_specific(self : J1939Id) -> Byte

#
J1939Id::pgn

fn J1939Id::pgn(self : J1939Id) -> UInt

Return the PGN, omitting destination address for PDU1 messages.

#
J1939Id::priority

fn J1939Id::priority(self : J1939Id) -> Byte

#
J1939Id::source

fn J1939Id::source(self : J1939Id) -> Byte

The source address of a J1939 message.

#
J1939Message

pub struct J1939Message {
identifier : J1939Id
payload : Array[Byte]
}

A J1939 application payload with its decoded identifier.

#
J1939Message::identifier

fn J1939Message::identifier(self : J1939Message) -> J1939Id

#
J1939Message::payload

fn J1939Message::payload(self : J1939Message) -> Array[Byte]

#
J1939Message::to_frame

fn J1939Message::to_frame(self : J1939Message) -> Frame raise FrameError

Create a data frame from a J1939 message.

#
J1939SpnDefinition

pub struct J1939SpnDefinition {
spn : UInt
name : String
start_bit : Int
length : Int
factor : Double
offset : Double
minimum : Double
maximum : Double
unit : String
}

A scale and offset definition for a J1939 SPN.

#
J1939SpnDefinition::decode

fn J1939SpnDefinition::decode(self : J1939SpnDefinition, data : Array[Byte]) -> Double

#
J1939SpnDefinition::encode

fn J1939SpnDefinition::encode(self : J1939SpnDefinition, data : Array[Byte], value : Double) -> Array[Byte]

#
J1939SpnDefinition::factor

fn J1939SpnDefinition::factor(self : J1939SpnDefinition) -> Double

#
J1939SpnDefinition::length

fn J1939SpnDefinition::length(self : J1939SpnDefinition) -> Int

#
J1939SpnDefinition::name

fn J1939SpnDefinition::name(self : J1939SpnDefinition) -> String

#
J1939SpnDefinition::offset

fn J1939SpnDefinition::offset(self : J1939SpnDefinition) -> Double

#
J1939SpnDefinition::spn

fn J1939SpnDefinition::spn(self : J1939SpnDefinition) -> UInt

#
J1939SpnDefinition::start_bit

fn J1939SpnDefinition::start_bit(self : J1939SpnDefinition) -> Int

#
J1939SpnDefinition::unit

fn J1939SpnDefinition::unit(self : J1939SpnDefinition) -> String

#
J1939TransportDirection

pub enum J1939TransportDirection {
J1939TransportTransmit
J1939TransportReceive
}

Direction of a J1939 transport-protocol session.

#
J1939TransportSession

pub struct J1939TransportSession {
pgn : UInt
direction : J1939TransportDirection
total_length : Int
packet_count : Int
payload : Array[Byte]
next_sequence : Int
state : J1939TransportState
last_timestamp_us : UInt64
timeout_us : UInt64
retries : Int
}

A stateful J1939 transport-protocol transfer.

#
J1939TransportSession::accept_announcement

fn J1939TransportSession::accept_announcement(self : J1939TransportSession, announcement : Array[Byte], timestamp_us : UInt64) -> Bool

Accept a BAM announcement for a receive session.

#
J1939TransportSession::accept_packet

fn J1939TransportSession::accept_packet(self : J1939TransportSession, packet : Array[Byte], timestamp_us : UInt64) -> Bool

Accept one TP.DT packet and return whether it advanced the transfer.

#
J1939TransportSession::complete

fn J1939TransportSession::complete(self : J1939TransportSession) -> Bool

#
J1939TransportSession::direction

#
J1939TransportSession::last_timestamp_us

fn J1939TransportSession::last_timestamp_us(self : J1939TransportSession) -> UInt64

#
J1939TransportSession::next_sequence

fn J1939TransportSession::next_sequence(self : J1939TransportSession) -> Int

#
J1939TransportSession::packet_count

fn J1939TransportSession::packet_count(self : J1939TransportSession) -> Int

#
J1939TransportSession::payload

#
J1939TransportSession::pgn

#
J1939TransportSession::received_length

fn J1939TransportSession::received_length(self : J1939TransportSession) -> Int

#
J1939TransportSession::retries

fn J1939TransportSession::retries(self : J1939TransportSession) -> Int

#
J1939TransportSession::start_transmit

fn J1939TransportSession::start_transmit(self : J1939TransportSession, payload : Array[Byte], timestamp_us : UInt64) -> Array[Array[Byte]] raise J1939Error

Start a BAM transfer and generate the announcement and data packets.

#
J1939TransportSession::state

#
J1939TransportSession::take_payload

fn J1939TransportSession::take_payload(self : J1939TransportSession) -> Array[Byte]?

#
J1939TransportSession::timed_out

fn J1939TransportSession::timed_out(self : J1939TransportSession, timestamp_us : UInt64) -> Bool

#
J1939TransportSession::total_length

fn J1939TransportSession::total_length(self : J1939TransportSession) -> Int

#
J1939TransportState

pub enum J1939TransportState {
J1939TransportIdle
J1939TransportAnnounced
J1939TransportTransferring
J1939TransportComplete
J1939TransportTimedOut
J1939TransportAborted
}

State of a J1939 BAM or TP.DT transfer.

#
LatencySample

pub struct LatencySample {
sequence : UInt
created_us : UInt64
completed_us : UInt64
payload_bytes : Int
}

One completed request/response timing sample.

#
LatencySample::completed_at

fn LatencySample::completed_at(self : LatencySample) -> UInt64

#
LatencySample::created_at

fn LatencySample::created_at(self : LatencySample) -> UInt64

#
LatencySample::duration

fn LatencySample::duration(self : LatencySample) -> UInt64

#
LatencySample::payload_bytes

fn LatencySample::payload_bytes(self : LatencySample) -> Int

#
LatencySample::sequence

fn LatencySample::sequence(self : LatencySample) -> UInt

#
LatencyStats

pub struct LatencyStats {
count : Int
minimum_us : UInt64?
maximum_us : UInt64?
average_us : Double
p95_us : UInt64?
jitter_us : UInt64
payload_bytes : Int
}

A summary of samples currently retained by a latency window.

#
LatencyStats::average

fn LatencyStats::average(self : LatencyStats) -> Double

#
LatencyStats::count

fn LatencyStats::count(self : LatencyStats) -> Int

#
LatencyStats::has_data

fn LatencyStats::has_data(self : LatencyStats) -> Bool

#
LatencyStats::jitter

fn LatencyStats::jitter(self : LatencyStats) -> UInt64

#
LatencyStats::maximum

fn LatencyStats::maximum(self : LatencyStats) -> UInt64?

#
LatencyStats::minimum

fn LatencyStats::minimum(self : LatencyStats) -> UInt64?

#
LatencyStats::p95

fn LatencyStats::p95(self : LatencyStats) -> UInt64?

#
LatencyStats::payload_bytes

fn LatencyStats::payload_bytes(self : LatencyStats) -> Int

#
LatencyStats::throughput_bytes_per_second

fn LatencyStats::throughput_bytes_per_second(self : LatencyStats, duration_us : UInt64) -> Double

Calculate payload throughput over an observation interval.

#
LatencyStats::to_text

fn LatencyStats::to_text(self : LatencyStats) -> String

Render a compact, stable summary for benchmark artifacts.

#
LatencyWindow

pub struct LatencyWindow {
capacity : Int
next_sequence : UInt
samples : Array[LatencySample]
last_completed_us : UInt64?
}

A bounded rolling timing window for transport and diagnostic paths.

#
LatencyWindow::capacity

fn LatencyWindow::capacity(self : LatencyWindow) -> Int

#
LatencyWindow::is_empty

fn LatencyWindow::is_empty(self : LatencyWindow) -> Bool

#
LatencyWindow::latest

Return the newest retained sample, if any.

#
LatencyWindow::length

fn LatencyWindow::length(self : LatencyWindow) -> Int

#
LatencyWindow::oldest

Return the oldest retained sample, if any.

#
LatencyWindow::percentile

fn LatencyWindow::percentile(self : LatencyWindow, percent : Int) -> UInt64 raise LatencyError

Return an arbitrary percentile using nearest-rank selection.

#
LatencyWindow::record

fn LatencyWindow::record(self : LatencyWindow, created_us : UInt64, completed_us : UInt64, payload_bytes : Int) -> UInt raise LatencyError

Record a completed sample and return its sequence number.

#
LatencyWindow::samples

#
LatencyWindow::stats

Calculate a stable summary of the retained timing samples.

#
Message

pub struct Message {
id : UInt
name : String
dlc : Int
signals : Array[Signal]
}

A CAN message with named signals.

#
Message::add_signal

fn Message::add_signal(self : Message, item : Signal) -> Unit

Add a signal to a message.

#
Message::decode

fn Message::decode(self : Message, data : Array[Byte]) -> DecodedMessage raise DbcRuntimeError

Decode all signals in a payload.

#
Message::dlc

fn Message::dlc(self : Message) -> Int

The configured payload length.

#
Message::encode_frame

fn Message::encode_frame(self : Message, values : Map[String, Double], extended? : Bool) -> Frame raise DbcRuntimeError

Encode a message definition and values as a CAN frame.

#
Message::encode_values

fn Message::encode_values(self : Message, values : Map[String, Double], initial? : Array[Byte]) -> Array[Byte] raise DbcRuntimeError

Encode physical signal values into a message payload.

#
Message::find

fn Message::find(self : Message, name : String) -> Signal?

Find a signal by name.

#
Message::id

fn Message::id(self : Message) -> UInt

The message identifier.

#
Message::name

fn Message::name(self : Message) -> String

The message name.

#
Message::required_bytes

fn Message::required_bytes(self : Message) -> Int

Return a message's maximum configured bit end.

#
Message::schema_text

fn Message::schema_text(self : Message) -> String

Return a stable schema summary for tooling.

#
Message::signal_count

fn Message::signal_count(self : Message) -> Int

Return the number of defined signals.

#
Message::signals

fn Message::signals(self : Message) -> Array[Signal]

Return signal definitions in source order.

#
Message::signals_by_start_bit

fn Message::signals_by_start_bit(self : Message) -> Array[Signal]

Return a message's signals ordered by start bit.

#
Message::validate

fn Message::validate(self : Message) -> Bool

Validate message size and all signal bit ranges.

#
NetworkDelivery

pub struct NetworkDelivery {
timestamp_us : UInt64
sender : Byte
frame : Frame
recipients : Array[String]
}

One broadcast delivery produced by CanNetwork::poll.

#
NetworkDelivery::frame

#
NetworkDelivery::recipients

fn NetworkDelivery::recipients(self : NetworkDelivery) -> Array[String]

#
NetworkDelivery::sender

fn NetworkDelivery::sender(self : NetworkDelivery) -> Byte

#
NetworkDelivery::timestamp

fn NetworkDelivery::timestamp(self : NetworkDelivery) -> UInt64

#
NetworkErrorBudget

pub struct NetworkErrorBudget {
max_error_rate : Double
max_drop_rate : Double
max_offline_nodes : Int
total_frames : Int
error_frames : Int
dropped_frames : Int
offline_nodes : Int
}

An error budget for a production CAN network.

#
NetworkErrorBudget::drop_rate

fn NetworkErrorBudget::drop_rate(self : NetworkErrorBudget) -> Double

#
NetworkErrorBudget::dropped_frames

fn NetworkErrorBudget::dropped_frames(self : NetworkErrorBudget) -> Int

#
NetworkErrorBudget::error_frames

fn NetworkErrorBudget::error_frames(self : NetworkErrorBudget) -> Int

#
NetworkErrorBudget::error_rate

fn NetworkErrorBudget::error_rate(self : NetworkErrorBudget) -> Double

#
NetworkErrorBudget::max_drop_rate

fn NetworkErrorBudget::max_drop_rate(self : NetworkErrorBudget) -> Double

#
NetworkErrorBudget::max_error_rate

fn NetworkErrorBudget::max_error_rate(self : NetworkErrorBudget) -> Double

#
NetworkErrorBudget::offline_nodes

fn NetworkErrorBudget::offline_nodes(self : NetworkErrorBudget) -> Int

#
NetworkErrorBudget::record_frame

fn NetworkErrorBudget::record_frame(self : NetworkErrorBudget, error : Bool, dropped : Bool) -> Unit

#
NetworkErrorBudget::set_offline_nodes

fn NetworkErrorBudget::set_offline_nodes(self : NetworkErrorBudget, count : Int) -> Unit

#
NetworkErrorBudget::total_frames

fn NetworkErrorBudget::total_frames(self : NetworkErrorBudget) -> Int

#
NetworkErrorBudget::within_budget

fn NetworkErrorBudget::within_budget(self : NetworkErrorBudget) -> Bool

#
NetworkHealthReport

pub struct NetworkHealthReport {
timestamp_us : UInt64
nodes : Array[NetworkNodeHealth]
online : Int
degraded : Int
offline : Int
budget : NetworkErrorBudget
}

A summary of network health at one observation point.

#
NetworkHealthReport::budget

#
NetworkHealthReport::degraded

fn NetworkHealthReport::degraded(self : NetworkHealthReport) -> Int

#
NetworkHealthReport::healthy

fn NetworkHealthReport::healthy(self : NetworkHealthReport) -> Bool

#
NetworkHealthReport::nodes

#
NetworkHealthReport::offline

fn NetworkHealthReport::offline(self : NetworkHealthReport) -> Int

#
NetworkHealthReport::online

fn NetworkHealthReport::online(self : NetworkHealthReport) -> Int

#
NetworkHealthReport::timestamp_us

fn NetworkHealthReport::timestamp_us(self : NetworkHealthReport) -> UInt64

#
NetworkHealthReport::to_text

fn NetworkHealthReport::to_text(self : NetworkHealthReport) -> String

#
NetworkHealthTracker

pub struct NetworkHealthTracker {
nodes : Array[NetworkNodeHealth]
budget : NetworkErrorBudget
samples : Int
last_timestamp_us : UInt64
}

A fleet-level health tracker for virtual or hardware-connected nodes.

#
NetworkHealthTracker::add_node

fn NetworkHealthTracker::add_node(self : NetworkHealthTracker, node : NetworkNodeHealth) -> Bool

#
NetworkHealthTracker::budget

#
NetworkHealthTracker::find

fn NetworkHealthTracker::find(self : NetworkHealthTracker, node_id : Byte) -> NetworkNodeHealth?

#
NetworkHealthTracker::last_timestamp_us

fn NetworkHealthTracker::last_timestamp_us(self : NetworkHealthTracker) -> UInt64

#
NetworkHealthTracker::nodes

#
NetworkHealthTracker::observe_drop

fn NetworkHealthTracker::observe_drop(self : NetworkHealthTracker) -> Unit

#
NetworkHealthTracker::observe_error

fn NetworkHealthTracker::observe_error(self : NetworkHealthTracker, node_id : Byte) -> Bool

#
NetworkHealthTracker::observe_frame

fn NetworkHealthTracker::observe_frame(self : NetworkHealthTracker, node_id : Byte, timestamp_us : UInt64, frame : Frame, transmit : Bool) -> Bool

#
NetworkHealthTracker::observe_heartbeat

fn NetworkHealthTracker::observe_heartbeat(self : NetworkHealthTracker, node_id : Byte, timestamp_us : UInt64, latency_us? : UInt64) -> Bool

#
NetworkHealthTracker::poll

fn NetworkHealthTracker::poll(self : NetworkHealthTracker, timestamp_us : UInt64) -> NetworkHealthReport

#
NetworkHealthTracker::reset

fn NetworkHealthTracker::reset(self : NetworkHealthTracker) -> Unit

#
NetworkHealthTracker::samples

fn NetworkHealthTracker::samples(self : NetworkHealthTracker) -> Int

#
NetworkNode

pub struct NetworkNode {
node_id : Byte
name : String
last_seen_us : UInt64
online : Bool
transmitted : Int
received : Int
}

A node registered with the network model.

#
NetworkNode::last_seen

fn NetworkNode::last_seen(self : NetworkNode) -> UInt64

#
NetworkNode::name

fn NetworkNode::name(self : NetworkNode) -> String

#
NetworkNode::node_id

fn NetworkNode::node_id(self : NetworkNode) -> Byte

#
NetworkNode::online

fn NetworkNode::online(self : NetworkNode) -> Bool

#
NetworkNode::received

fn NetworkNode::received(self : NetworkNode) -> Int

#
NetworkNode::transmitted

fn NetworkNode::transmitted(self : NetworkNode) -> Int

#
NetworkNodeHealth

pub struct NetworkNodeHealth {
node_id : Byte
name : String
state : NetworkNodeHealthState
last_seen_us : UInt64
timeout_us : UInt64
received : Int
transmitted : Int
errors : Int
missed_heartbeats : Int
latency_samples : Array[UInt64]
}

A node health sample with counters and timing.

#
NetworkNodeHealth::average_latency_us

fn NetworkNodeHealth::average_latency_us(self : NetworkNodeHealth) -> UInt64

#
NetworkNodeHealth::errors

fn NetworkNodeHealth::errors(self : NetworkNodeHealth) -> Int

#
NetworkNodeHealth::last_seen_us

fn NetworkNodeHealth::last_seen_us(self : NetworkNodeHealth) -> UInt64

#
NetworkNodeHealth::latency_samples

fn NetworkNodeHealth::latency_samples(self : NetworkNodeHealth) -> Array[UInt64]

#
NetworkNodeHealth::missed_heartbeats

fn NetworkNodeHealth::missed_heartbeats(self : NetworkNodeHealth) -> Int

#
NetworkNodeHealth::name

fn NetworkNodeHealth::name(self : NetworkNodeHealth) -> String

#
NetworkNodeHealth::node_id

fn NetworkNodeHealth::node_id(self : NetworkNodeHealth) -> Byte

#
NetworkNodeHealth::observe_error

fn NetworkNodeHealth::observe_error(self : NetworkNodeHealth) -> Unit

#
NetworkNodeHealth::observe_frame

fn NetworkNodeHealth::observe_frame(self : NetworkNodeHealth, timestamp_us : UInt64, transmit : Bool) -> Unit

#
NetworkNodeHealth::observe_heartbeat

fn NetworkNodeHealth::observe_heartbeat(self : NetworkNodeHealth, timestamp_us : UInt64, latency_us? : UInt64) -> Unit

#
NetworkNodeHealth::online

fn NetworkNodeHealth::online(self : NetworkNodeHealth) -> Bool

#
NetworkNodeHealth::p95_latency_us

fn NetworkNodeHealth::p95_latency_us(self : NetworkNodeHealth) -> UInt64

#
NetworkNodeHealth::poll

fn NetworkNodeHealth::poll(self : NetworkNodeHealth, timestamp_us : UInt64) -> NetworkNodeHealthState

#
NetworkNodeHealth::received

fn NetworkNodeHealth::received(self : NetworkNodeHealth) -> Int

#
NetworkNodeHealth::state

#
NetworkNodeHealth::timeout_us

fn NetworkNodeHealth::timeout_us(self : NetworkNodeHealth) -> UInt64

#
NetworkNodeHealth::to_text

fn NetworkNodeHealth::to_text(self : NetworkNodeHealth) -> String

#
NetworkNodeHealth::transmitted

fn NetworkNodeHealth::transmitted(self : NetworkNodeHealth) -> Int

#
NetworkNodeHealthState

pub enum NetworkNodeHealthState {
NetworkNodeUnknown
NetworkNodeHealthy
NetworkNodeDegraded
NetworkNodeOffline
NetworkNodeMaintenance
}

Operational state used by a network health dashboard.

#
NodeRegistry

pub struct NodeRegistry {
nodes : Array[CanNode]
}

A registry used by simulations and gateway applications.

#
NodeRegistry::deliver

fn NodeRegistry::deliver(self : NodeRegistry, frame : Frame) -> Array[String]

Deliver a frame to every matching registered node.

#
NodeRegistry::find

fn NodeRegistry::find(self : NodeRegistry, node_id : Byte) -> CanNode?

#
NodeRegistry::length

fn NodeRegistry::length(self : NodeRegistry) -> Int

#
NodeRegistry::record_transmission

fn NodeRegistry::record_transmission(self : NodeRegistry, node_id : Byte) -> Unit raise NodeRegistryError

Record a transmission for a node.

#
NodeRegistry::register

fn NodeRegistry::register(self : NodeRegistry, node_id : Byte, name : String, filter : Filter) -> Unit raise NodeRegistryError

#
NodeRegistry::unregister

fn NodeRegistry::unregister(self : NodeRegistry, node_id : Byte) -> Unit raise NodeRegistryError

#
PayloadCodec

pub struct PayloadCodec {
options : PayloadCodecOptions
encoded : Int
decoded : Int
failures : Int
next_counter : Byte
}

A reusable cyclic payload codec.

#
PayloadCodec::decode

fn PayloadCodec::decode(self : PayloadCodec, data : Array[Byte], expected_counter : Byte?) -> PayloadCodecResult

Decode and validate a received payload against the rolling counter.

#
PayloadCodec::decoded

fn PayloadCodec::decoded(self : PayloadCodec) -> Int

#
PayloadCodec::encode

fn PayloadCodec::encode(self : PayloadCodec, data : Array[Byte]) -> PayloadCodecResult

Encode a payload, setting the configured counter and integrity byte.

#
PayloadCodec::encoded

fn PayloadCodec::encoded(self : PayloadCodec) -> Int

#
PayloadCodec::failures

fn PayloadCodec::failures(self : PayloadCodec) -> Int

#
PayloadCodec::next_counter

fn PayloadCodec::next_counter(self : PayloadCodec) -> Byte

#
PayloadCodec::options

#
PayloadCodec::reset

fn PayloadCodec::reset(self : PayloadCodec) -> Unit

#
PayloadCodecOptions

pub struct PayloadCodecOptions {
profile : PayloadCodecProfile
counter_offset : Int
counter_high_nibble : Bool
crc_offset : Int
checksum_offset : Int
expected_length : Int
counter_modulus : Int
}

Codec layout options for a cyclic payload.

#
PayloadCodecOptions::checksum_offset

fn PayloadCodecOptions::checksum_offset(self : PayloadCodecOptions) -> Int

#
PayloadCodecOptions::counter_high_nibble

fn PayloadCodecOptions::counter_high_nibble(self : PayloadCodecOptions) -> Bool

#
PayloadCodecOptions::counter_modulus

fn PayloadCodecOptions::counter_modulus(self : PayloadCodecOptions) -> Int

#
PayloadCodecOptions::counter_offset

fn PayloadCodecOptions::counter_offset(self : PayloadCodecOptions) -> Int

#
PayloadCodecOptions::crc_offset

fn PayloadCodecOptions::crc_offset(self : PayloadCodecOptions) -> Int

#
PayloadCodecOptions::expected_length

fn PayloadCodecOptions::expected_length(self : PayloadCodecOptions) -> Int

#
PayloadCodecOptions::profile

#
PayloadCodecProfile

pub(all) enum PayloadCodecProfile {
PayloadCodecPlain
PayloadCodecCounterCrc
PayloadCodecCounterChecksum
PayloadCodecAliveAndCrc
}

Application payload profile used by a safety or control message.

#
PayloadCodecResult

pub struct PayloadCodecResult {
status : PayloadCodecStatus
data : Array[Byte]
counter : Byte?
expected_counter : Byte?
checksum : Byte?
}

A codec result includes transformed data and validation state.

#
PayloadCodecResult::accepted

fn PayloadCodecResult::accepted(self : PayloadCodecResult) -> Bool

#
PayloadCodecResult::checksum

fn PayloadCodecResult::checksum(self : PayloadCodecResult) -> Byte?

#
PayloadCodecResult::counter

fn PayloadCodecResult::counter(self : PayloadCodecResult) -> Byte?

#
PayloadCodecResult::data

fn PayloadCodecResult::data(self : PayloadCodecResult) -> Array[Byte]

#
PayloadCodecResult::expected_counter

fn PayloadCodecResult::expected_counter(self : PayloadCodecResult) -> Byte?

#
PayloadCodecResult::status

#
PayloadCodecResult::to_text

fn PayloadCodecResult::to_text(self : PayloadCodecResult) -> String

#
PayloadCodecStatus

pub(all) enum PayloadCodecStatus {
PayloadCodecAccepted
PayloadCodecBadLength
PayloadCodecBadCounter
PayloadCodecBadCrc
PayloadCodecBadChecksum
}

Result classification from a payload codec operation.

#
PdoMapEntry

pub struct PdoMapEntry {
index : UInt
sub_index : Byte
bit_offset : Int
bit_length : Int
}

One object-dictionary entry mapped into a PDO.

#
PdoMapEntry::bit_length

fn PdoMapEntry::bit_length(self : PdoMapEntry) -> Int

#
PdoMapEntry::bit_offset

fn PdoMapEntry::bit_offset(self : PdoMapEntry) -> Int

#
PdoMapEntry::index

fn PdoMapEntry::index(self : PdoMapEntry) -> UInt

#
PdoMapEntry::sub_index

fn PdoMapEntry::sub_index(self : PdoMapEntry) -> Byte

#
PdoMapping

pub struct PdoMapping {
entries : Array[PdoMapEntry]
payload_bytes : Int
}

A bit-packed PDO mapping.

#
PdoMapping::add

fn PdoMapping::add(self : PdoMapping, index : UInt, sub_index : Byte, bit_length : Int) -> Unit raise PdoError

Add a mapping entry at the next available bit offset.

#
PdoMapping::entries

fn PdoMapping::entries(self : PdoMapping) -> Array[PdoMapEntry]

#
PdoMapping::length

fn PdoMapping::length(self : PdoMapping) -> Int

#
PdoMapping::pack

fn PdoMapping::pack(self : PdoMapping, values : Array[UInt]) -> Array[Byte] raise PdoError

Pack values in mapping order into a little-endian bit payload.

#
PdoMapping::payload_bytes

fn PdoMapping::payload_bytes(self : PdoMapping) -> Int

#
PdoMapping::unpack

fn PdoMapping::unpack(self : PdoMapping, data : Array[Byte]) -> Array[PdoValue] raise PdoError

Unpack all mapped values from a PDO payload.

#
PdoValue

pub struct PdoValue {
index : UInt
sub_index : Byte
value : UInt
}

A decoded mapped value.

#
PdoValue::index

fn PdoValue::index(self : PdoValue) -> UInt

#
PdoValue::sub_index

fn PdoValue::sub_index(self : PdoValue) -> Byte

#
PdoValue::value

fn PdoValue::value(self : PdoValue) -> UInt

#
PeriodicPublisher

pub struct PeriodicPublisher {
source : String
frame : Frame
period_us : UInt64
remaining : Int
}

A periodic publisher registered with a simulation.

#
Pgn

pub struct Pgn {
number : UInt
name : String
data_length : Int
}

A J1939 parameter group entry.

#
Pgn::name

fn Pgn::name(self : Pgn) -> String

Return the PGN label.

#
Pgn::number

fn Pgn::number(self : Pgn) -> UInt

Return the PGN number.

#
Protocol

pub enum Protocol {
Can20
CanFd
}

A CAN bus protocol version.

#
QueueItem

pub struct QueueItem {
sequence : UInt
channel : Byte
frame : Frame
enqueued_us : UInt64
deadline_us : UInt64
}

A queued frame with timing and channel metadata.

#
QueueItem::channel

fn QueueItem::channel(self : QueueItem) -> Byte

#
QueueItem::deadline

fn QueueItem::deadline(self : QueueItem) -> UInt64

#
QueueItem::enqueued_at

fn QueueItem::enqueued_at(self : QueueItem) -> UInt64

#
QueueItem::frame

fn QueueItem::frame(self : QueueItem) -> Frame

#
QueueItem::sequence

fn QueueItem::sequence(self : QueueItem) -> UInt

#
RouteRule

pub struct RouteRule {
name : String
filter : Filter
output_id : UInt?
output_extended : Bool?
prefix : Array[Byte]
strip_prefix : Int
}

A deterministic one-way gateway rule.

#
RouteRule::name

fn RouteRule::name(self : RouteRule) -> String

Return a route's stable name.

#
RouteRule::prefix

fn RouteRule::prefix(self : RouteRule) -> Array[Byte]

Return the rule's payload prefix.

#
RoutedFrame

pub struct RoutedFrame {
rule_name : String
input_id : UInt
frame : Frame
}

A frame accepted and transformed by a route.

#
RoutedFrame::frame

fn RoutedFrame::frame(self : RoutedFrame) -> Frame

#
RoutedFrame::input_id

fn RoutedFrame::input_id(self : RoutedFrame) -> UInt

#
RoutedFrame::rule_name

fn RoutedFrame::rule_name(self : RoutedFrame) -> String

#
ScheduledFrame

pub struct ScheduledFrame {
timestamp_us : UInt64
frame : Frame
source : String
}

A frame scheduled for a simulated bus time.

#
ScheduledFrame::frame

fn ScheduledFrame::frame(self : ScheduledFrame) -> Frame

#
ScheduledFrame::source

fn ScheduledFrame::source(self : ScheduledFrame) -> String

#
ScheduledFrame::timestamp

fn ScheduledFrame::timestamp(self : ScheduledFrame) -> UInt64

#
SchedulerTick

pub struct SchedulerTick {
timestamp_us : UInt64
task_name : String
frame : Frame
late : Bool
}

A scheduler execution result.

#
SchedulerTick::frame

fn SchedulerTick::frame(self : SchedulerTick) -> Frame

#
SchedulerTick::is_late

fn SchedulerTick::is_late(self : SchedulerTick) -> Bool

#
SchedulerTick::task_name

fn SchedulerTick::task_name(self : SchedulerTick) -> String

#
SchedulerTick::timestamp

fn SchedulerTick::timestamp(self : SchedulerTick) -> UInt64

#
Signal

pub struct Signal {
name : String
start_bit : Int
size : Int
little_endian : Bool
signed : Bool
factor : Double
offset : Double
minimum : Double
maximum : Double
unit : String
}

A DBC signal description.

#
Signal::accepts

fn Signal::accepts(self : Signal, value : Double) -> Bool

Check a physical value against the configured range.

#
Signal::decode

fn Signal::decode(self : Signal, data : Array[Byte]) -> Double

Decode a physical value using factor and offset.

#
Signal::decode_physical

fn Signal::decode_physical(self : Signal, data : Array[Byte]) -> Double

Decode a physical value while honoring the DBC signedness flag.

#
Signal::decode_raw

fn Signal::decode_raw(self : Signal, data : Array[Byte]) -> UInt

Extract a raw signal value from a payload.

#
Signal::decode_signed

fn Signal::decode_signed(self : Signal, data : Array[Byte]) -> Int

Decode a signed raw value using the signal width.

#
Signal::encode

fn Signal::encode(self : Signal, data : Array[Byte], value : Double) -> Array[Byte]

Encode a physical value into a payload copy.

#
Signal::encode_raw

fn Signal::encode_raw(self : Signal, data : Array[Byte], value : UInt) -> Array[Byte]

Encode a raw value into a payload copy.

#
Signal::factor

fn Signal::factor(self : Signal) -> Double

#
Signal::has_range

fn Signal::has_range(self : Signal) -> Bool

Return the signal's inclusive physical range when configured.

#
Signal::is_signed

fn Signal::is_signed(self : Signal) -> Bool

Return whether this signal uses signed two's-complement values.

#
Signal::is_valid

fn Signal::is_valid(self : Signal, dlc : Int) -> Bool

Check whether a signal fits inside a payload of dlc bytes.

#
Signal::little_endian

fn Signal::little_endian(self : Signal) -> Bool

Return whether the signal uses Intel/little-endian bit ordering.

#
Signal::maximum

fn Signal::maximum(self : Signal) -> Double

#
Signal::minimum

fn Signal::minimum(self : Signal) -> Double

#
Signal::name

fn Signal::name(self : Signal) -> String

The signal name.

#
Signal::offset

fn Signal::offset(self : Signal) -> Double

#
Signal::raw_max

fn Signal::raw_max(self : Signal) -> UInt

Return the largest raw unsigned value representable by this signal.

#
Signal::size

fn Signal::size(self : Signal) -> Int

Return the configured signal bit size.

#
Signal::start_bit

fn Signal::start_bit(self : Signal) -> Int

The signal's start bit.

#
Signal::unit

fn Signal::unit(self : Signal) -> String

#
Simulation

pub struct Simulation {
now_us : UInt64
bus : VirtualBus
events : Array[ScheduledFrame]
publishers : Array[PeriodicPublisher]
trace : Trace
scheduled : Int
delivered : Int
dropped : Int
arbitration_bits : UInt64
bitrate_kbps : UInt
}

A deterministic, single-threaded CAN network model.

#
Simulation::add_periodic

fn Simulation::add_periodic(self : Simulation, source : String, frame : Frame, first_timestamp_us : UInt64, period_us : UInt64, count : Int) -> Unit raise SimulationError

Register a periodic publisher and schedule its first event.

#
Simulation::bus

fn Simulation::bus(self : Simulation) -> VirtualBus

#
Simulation::now

fn Simulation::now(self : Simulation) -> UInt64

#
Simulation::pending_events

fn Simulation::pending_events(self : Simulation) -> Int

#
Simulation::receive

fn Simulation::receive(self : Simulation) -> Frame?

Drain the highest-priority frame ready at the current time.

#
Simulation::report

fn Simulation::report(self : Simulation, start_us : UInt64) -> SimulationReport

Return a summary of the run so far.

#
Simulation::run_steps

fn Simulation::run_steps(self : Simulation, limit : Int) -> Int raise SimulationError

Execute at most limit events.

#
Simulation::run_until

fn Simulation::run_until(self : Simulation, end_us : UInt64) -> Int raise SimulationError

Execute events up to an inclusive timestamp.

#
Simulation::schedule

fn Simulation::schedule(self : Simulation, timestamp_us : UInt64, frame : Frame, source? : String) -> Unit raise SimulationError

Schedule a frame at an absolute microsecond timestamp.

#
Simulation::step

fn Simulation::step(self : Simulation) -> ScheduledFrame?

Execute the next event and deliver it through the virtual bus.

#
Simulation::trace

fn Simulation::trace(self : Simulation) -> Trace

Return the captured trace.

#
SimulationReport

pub struct SimulationReport {
start_us : UInt64
end_us : UInt64
scheduled : Int
delivered : Int
dropped : Int
arbitration_bits : UInt64
}

Counters produced by a deterministic simulation run.

#
SimulationReport::arbitration_bits

fn SimulationReport::arbitration_bits(self : SimulationReport) -> UInt64

#
SimulationReport::delivered

fn SimulationReport::delivered(self : SimulationReport) -> Int

#
SimulationReport::dropped

fn SimulationReport::dropped(self : SimulationReport) -> Int

#
SimulationReport::duration_us

fn SimulationReport::duration_us(self : SimulationReport) -> UInt64

#
SimulationReport::scheduled

fn SimulationReport::scheduled(self : SimulationReport) -> Int

#
SimulationScenario

pub struct SimulationScenario {
name : String
capacity : Int
bitrate_kbps : UInt
events : Array[SimulationScenarioEvent]
assertions : Array[SimulationScenarioAssertion]
state : SimulationScenarioState
}

A reusable deterministic scenario for ECU and gateway testing.

#
SimulationScenario::add_assertion

fn SimulationScenario::add_assertion(self : SimulationScenario, assertion : SimulationScenarioAssertion) -> Unit

#
SimulationScenario::assertions

#
SimulationScenario::bitrate_kbps

fn SimulationScenario::bitrate_kbps(self : SimulationScenario) -> UInt

#
SimulationScenario::capacity

fn SimulationScenario::capacity(self : SimulationScenario) -> Int

#
SimulationScenario::clear

fn SimulationScenario::clear(self : SimulationScenario) -> Unit

#
SimulationScenario::events

#
SimulationScenario::name

fn SimulationScenario::name(self : SimulationScenario) -> String

#
SimulationScenario::ready

fn SimulationScenario::ready(self : SimulationScenario) -> Bool

#
SimulationScenario::schedule

fn SimulationScenario::schedule(self : SimulationScenario, timestamp_us : UInt64, frame : Frame, source? : String) -> Bool

#
SimulationScenario::schedule_periodic

fn SimulationScenario::schedule_periodic(self : SimulationScenario, first_timestamp_us : UInt64, period_us : UInt64, count : Int, frame : Frame, source? : String) -> Bool

#
SimulationScenario::state

#
SimulationScenario::to_text

fn SimulationScenario::to_text(self : SimulationScenario) -> String

#
SimulationScenarioAssertion

pub enum SimulationScenarioAssertion {
SimulationAssertDeliveredAtLeast(Int)
SimulationAssertDroppedAtMost(Int)
SimulationAssertDurationAtMost(UInt64)
SimulationAssertIdentifierSeen(UInt)
SimulationAssertHealth(BusHealthState)
}

An assertion applied to a completed simulation report.

#
SimulationScenarioEvent

pub struct SimulationScenarioEvent {
timestamp_us : UInt64
frame : Frame
source : String
}

An event scheduled in a reusable simulation scenario.

#
SimulationScenarioEvent::frame

#
SimulationScenarioEvent::source

#
SimulationScenarioEvent::timestamp_us

fn SimulationScenarioEvent::timestamp_us(self : SimulationScenarioEvent) -> UInt64

#
SimulationScenarioResult

pub struct SimulationScenarioResult {
name : String
state : SimulationScenarioState
report : SimulationReport
assertions : Array[SimulationScenarioAssertion]
failures : Array[String]
}

A result produced by running a scenario.

#
SimulationScenarioResult::assertions

#
SimulationScenarioResult::failures

#
SimulationScenarioResult::name

#
SimulationScenarioResult::passed

#
SimulationScenarioResult::report

#
SimulationScenarioResult::state

#
SimulationScenarioResult::to_text

#
SimulationScenarioState

pub enum SimulationScenarioState {
SimulationScenarioDraft
SimulationScenarioReady
SimulationScenarioRunning
SimulationScenarioPassed
SimulationScenarioFailed
}

Lifecycle state of a deterministic simulation scenario.

#
Trace

pub struct Trace {
entries : Array[TraceEntry]
}

An append-only trace that can be replayed deterministically.

#
Trace::between

fn Trace::between(self : Trace, start_us : UInt64, end_us : UInt64) -> Trace

Select entries in a closed timestamp interval.

#
Trace::entries

fn Trace::entries(self : Trace) -> Array[TraceEntry]

Return entries in capture order.

#
Trace::filter_id

fn Trace::filter_id(self : Trace, id : UInt) -> Trace

Select entries matching an identifier.

#
Trace::frames

fn Trace::frames(self : Trace) -> Array[Frame]

Return all frames in capture order.

#
Trace::length

fn Trace::length(self : Trace) -> Int

Return the number of captured frames.

#
Trace::record

fn Trace::record(self : Trace, timestamp_us : UInt64, frame : Frame) -> Unit

Append a timestamped frame.

#
Trace::replay

fn Trace::replay(self : Trace, bus : VirtualBus) -> Int

Replay frames to a virtual bus, preserving capture order.

#
Trace::sorted

fn Trace::sorted(self : Trace) -> Trace

Return a capture-order copy sorted by timestamp and arbitration id.

#
Trace::time_range

fn Trace::time_range(self : Trace) -> (UInt64, UInt64)?

Return the first and last capture timestamps.

#
Trace::to_text

fn Trace::to_text(self : Trace) -> String

Encode a trace in a stable CSV-like text format.

#
Trace::validate

fn Trace::validate(self : Trace) -> Unit raise TraceError

Validate timestamps and frame invariants in capture order.

#
TraceDiff

pub struct TraceDiff {
ordinal : Int
kind : TraceDiffKind
left : TraceQueryMatch?
right : TraceQueryMatch?
}

#
TraceDiff::kind

fn TraceDiff::kind(self : TraceDiff) -> TraceDiffKind

#
TraceDiff::left

fn TraceDiff::left(self : TraceDiff) -> TraceQueryMatch?

#
TraceDiff::ordinal

fn TraceDiff::ordinal(self : TraceDiff) -> Int

#
TraceDiff::right

fn TraceDiff::right(self : TraceDiff) -> TraceQueryMatch?

#
TraceDiffKind

pub enum TraceDiffKind {
TraceDiffMissingLeft
TraceDiffMissingRight
TraceDiffIdentifier
TraceDiffPayload
TraceDiffTimestamp
}

A difference between two captures at a matching ordinal.

#
TraceEntry

pub struct TraceEntry {
timestamp_us : UInt64
frame : Frame
}

A timestamped frame captured from a virtual bus.

#
TraceEntry::frame

fn TraceEntry::frame(self : TraceEntry) -> Frame

The captured frame.

#
TraceEntry::timestamp

fn TraceEntry::timestamp(self : TraceEntry) -> UInt64

The capture timestamp in microseconds.

#
TraceExportFormat

pub enum TraceExportFormat {
TraceExportCanText
TraceExportCsv
TraceExportSummary
TraceExportReplayScript
}

Stable output formats for trace artifacts.

#
TraceExportOptions

pub struct TraceExportOptions {
format : TraceExportFormat
include_channel : Bool
include_sequence : Bool
include_header : Bool
normalize_timestamps : Bool
max_rows : Int
}

Options controlling deterministic trace export.

#
TraceExportOptions::format

#
TraceExportOptions::include_channel

fn TraceExportOptions::include_channel(self : TraceExportOptions) -> Bool

#
TraceExportOptions::include_header

fn TraceExportOptions::include_header(self : TraceExportOptions) -> Bool

#
TraceExportOptions::include_sequence

fn TraceExportOptions::include_sequence(self : TraceExportOptions) -> Bool

#
TraceExportOptions::max_rows

fn TraceExportOptions::max_rows(self : TraceExportOptions) -> Int

#
TraceExportOptions::normalize_timestamps

fn TraceExportOptions::normalize_timestamps(self : TraceExportOptions) -> Bool

#
TraceExportRecord

pub struct TraceExportRecord {
timestamp_us : UInt64
sequence : Int
channel : String
frame : Frame
}

A line-level export record used by CSV and replay tools.

#
TraceExportRecord::channel

fn TraceExportRecord::channel(self : TraceExportRecord) -> String

#
TraceExportRecord::frame

#
TraceExportRecord::relative_to

fn TraceExportRecord::relative_to(self : TraceExportRecord, base : UInt64) -> UInt64

#
TraceExportRecord::sequence

fn TraceExportRecord::sequence(self : TraceExportRecord) -> Int

#
TraceExportRecord::timestamp_us

fn TraceExportRecord::timestamp_us(self : TraceExportRecord) -> UInt64

#
TraceExporter

pub struct TraceExporter {
options : TraceExportOptions
records : Array[TraceExportRecord]
rows : Int
bytes : Int
errors : Int
}

A stateful exporter that can be used incrementally by a logger.

#
TraceExporter::add

fn TraceExporter::add(self : TraceExporter, record : TraceExportRecord) -> Bool

#
TraceExporter::add_trace

fn TraceExporter::add_trace(self : TraceExporter, trace : Trace, channel? : String) -> Int

#
TraceExporter::bytes

fn TraceExporter::bytes(self : TraceExporter) -> Int

#
TraceExporter::errors

fn TraceExporter::errors(self : TraceExporter) -> Int

#
TraceExporter::records

#
TraceExporter::render

fn TraceExporter::render(self : TraceExporter) -> String

#
TraceExporter::rows

fn TraceExporter::rows(self : TraceExporter) -> Int

#
TraceQueryBucket

pub struct TraceQueryBucket {
start_us : UInt64
end_us : UInt64
frames : Int
payload_bytes : Int
wire_bits : Int
}

A fixed time bucket for frame-rate and load dashboards.

#
TraceQueryBucket::end_us

fn TraceQueryBucket::end_us(self : TraceQueryBucket) -> UInt64

#
TraceQueryBucket::frames

fn TraceQueryBucket::frames(self : TraceQueryBucket) -> Int

#
TraceQueryBucket::payload_bytes

fn TraceQueryBucket::payload_bytes(self : TraceQueryBucket) -> Int

#
TraceQueryBucket::start_us

fn TraceQueryBucket::start_us(self : TraceQueryBucket) -> UInt64

#
TraceQueryBucket::utilization

fn TraceQueryBucket::utilization(self : TraceQueryBucket, bitrate_kbps : UInt) -> Double

#
TraceQueryBucket::wire_bits

fn TraceQueryBucket::wire_bits(self : TraceQueryBucket) -> Int

#
TraceQueryMatch

pub struct TraceQueryMatch {
index : Int
timestamp_us : UInt64
frame : Frame
}

A selected trace entry with its original position.

#
TraceQueryMatch::frame

#
TraceQueryMatch::index

fn TraceQueryMatch::index(self : TraceQueryMatch) -> Int

#
TraceQueryMatch::latency_from

fn TraceQueryMatch::latency_from(self : TraceQueryMatch, timestamp_us : UInt64) -> UInt64

#
TraceQueryMatch::timestamp_us

fn TraceQueryMatch::timestamp_us(self : TraceQueryMatch) -> UInt64

#
TraceQueryPredicate

pub enum TraceQueryPredicate {
TraceQueryAny
TraceQueryIdentifier(UInt)
TraceQueryExtended(Bool)
TraceQueryProtocol(Protocol)
TraceQueryFrameClass(FrameClass)
TraceQueryPayloadLength(Int)
TraceQueryPayloadAtLeast(Int)
TraceQueryPayloadByte(Int, Byte)
TraceQueryIdentifierRange(UInt, UInt)
}

A predicate for selecting frames from a capture trace.

#
TraceQuerySpec

pub struct TraceQuerySpec {
start_us : UInt64?
end_us : UInt64?
predicates : Array[TraceQueryPredicate]
inspected : Int
matched : Int
}

A time and predicate specification for trace analysis.

#
TraceQuerySpec::after

fn TraceQuerySpec::after(self : TraceQuerySpec, start_us : UInt64) -> Unit

#
TraceQuerySpec::before

fn TraceQuerySpec::before(self : TraceQuerySpec, end_us : UInt64) -> Unit

#
TraceQuerySpec::between

fn TraceQuerySpec::between(self : TraceQuerySpec, start_us : UInt64, end_us : UInt64) -> Unit

#
TraceQuerySpec::inspected

fn TraceQuerySpec::inspected(self : TraceQuerySpec) -> Int

#
TraceQuerySpec::matched

fn TraceQuerySpec::matched(self : TraceQuerySpec) -> Int

#
TraceQuerySpec::predicates

#
TraceQuerySpec::reset_counters

fn TraceQuerySpec::reset_counters(self : TraceQuerySpec) -> Unit

#
TraceQuerySpec::where_is

fn TraceQuerySpec::where_is(self : TraceQuerySpec, predicate : TraceQueryPredicate) -> Unit

#
TraceReplayEvent

pub struct TraceReplayEvent {
offset_us : UInt64
frame : Frame
original_index : Int
}

A normalized replay event with a relative timestamp.

#
TraceReplayEvent::frame

#
TraceReplayEvent::offset_us

fn TraceReplayEvent::offset_us(self : TraceReplayEvent) -> UInt64

#
TraceReplayEvent::original_index

fn TraceReplayEvent::original_index(self : TraceReplayEvent) -> Int

#
TraceReplayPlan

pub struct TraceReplayPlan {
events : Array[TraceReplayEvent]
scale_num : UInt64
scale_den : UInt64
cursor : Int
}

A replay plan that supports deterministic time scaling and filtering.

#
TraceReplayPlan::at

fn TraceReplayPlan::at(self : TraceReplayPlan, offset_us : UInt64) -> Array[TraceReplayEvent]

#
TraceReplayPlan::cursor

fn TraceReplayPlan::cursor(self : TraceReplayPlan) -> Int

#
TraceReplayPlan::duration_us

fn TraceReplayPlan::duration_us(self : TraceReplayPlan) -> UInt64

#
TraceReplayPlan::events

#
TraceReplayPlan::next

#
TraceReplayPlan::reset

fn TraceReplayPlan::reset(self : TraceReplayPlan) -> Unit

#
TraceReplayPlan::scale_den

fn TraceReplayPlan::scale_den(self : TraceReplayPlan) -> UInt64

#
TraceReplayPlan::scale_num

fn TraceReplayPlan::scale_num(self : TraceReplayPlan) -> UInt64

#
UdsResponseInfo

pub struct UdsResponseInfo {
positive : Bool
response_service : Byte
payload : Array[Byte]
negative_code : Byte?
}

A parsed positive or negative response with its service identifier.

#
UdsResponseInfo::is_positive

fn UdsResponseInfo::is_positive(self : UdsResponseInfo) -> Bool

#
UdsResponseInfo::negative_code

fn UdsResponseInfo::negative_code(self : UdsResponseInfo) -> Byte?

#
UdsResponseInfo::payload

fn UdsResponseInfo::payload(self : UdsResponseInfo) -> Array[Byte]

#
UdsResponseInfo::response_service

fn UdsResponseInfo::response_service(self : UdsResponseInfo) -> Byte

#
UdsService

pub enum UdsService {
DiagnosticSessionControl
EcuReset
ReadDataByIdentifier
WriteDataByIdentifier
ReadMemoryByAddress
WriteMemoryByAddress
RoutineControl
SecurityAccess
CommunicationControl
ClearDiagnosticInformation
ReadDtcInformation
RequestDownload
TransferData
RequestTransferExit
TesterPresent
}

Common UDS service identifiers used by a diagnostic client.

#
UdsSession

pub struct UdsSession {
state : UdsSessionState
unlocked : Bool
last_activity_us : UInt64
p2_timeout_us : UInt64
pending_service : UdsService?
}

A small deterministic UDS session tracker.

#
UdsSession::accept

fn UdsSession::accept(self : UdsSession, request : DiagnosticRequest, payload : Array[Byte], timestamp_us : UInt64) -> UdsResponseInfo raise UdsSessionError

Apply a diagnostic response and advance session state.

#
UdsSession::allows

fn UdsSession::allows(self : UdsSession, service : UdsService) -> Bool

Return whether a service is safe in the current state.

#
UdsSession::begin

fn UdsSession::begin(self : UdsSession, request : DiagnosticRequest, timestamp_us : UInt64) -> DiagnosticRequest raise UdsSessionError

Begin a request and remember the expected service.

#
UdsSession::change_state

fn UdsSession::change_state(self : UdsSession, target : UdsSessionState) -> Unit raise UdsSessionError

Force a session change after an externally validated response.

#
UdsSession::is_unlocked

fn UdsSession::is_unlocked(self : UdsSession) -> Bool

#
UdsSession::last_activity

fn UdsSession::last_activity(self : UdsSession) -> UInt64

#
UdsSession::pending_service

fn UdsSession::pending_service(self : UdsSession) -> UdsService?

#
UdsSession::state

#
UdsSession::timed_out

fn UdsSession::timed_out(self : UdsSession, timestamp_us : UInt64) -> Bool

Check whether the response timer has expired.

#
UdsSession::touch

fn UdsSession::touch(self : UdsSession, timestamp_us : UInt64) -> Unit

Mark the current activity time.

#
UdsSessionState

pub enum UdsSessionState {
DefaultSession
ProgrammingSession
ExtendedDiagnosticSession
SafetySystemDiagnosticSession
LockedSession
} derive(
Debug
)

UDS application session states.

#
VirtualBus

pub struct VirtualBus {
capacity : Int
queue : Array[Frame]
filters : FilterBank
dropped : Int
}

A deterministic in-memory CAN bus.

#
VirtualBus::dropped

fn VirtualBus::dropped(self : VirtualBus) -> Int

Number of dropped frames.

#
VirtualBus::filters

fn VirtualBus::filters(self : VirtualBus) -> FilterBank

Configure the receiver acceptance filters.

#
VirtualBus::pending

fn VirtualBus::pending(self : VirtualBus) -> Int

Number of pending frames.

#
VirtualBus::publish

fn VirtualBus::publish(self : VirtualBus, frame : Frame) -> Bool

Publish a frame. The queue is ordered by arbitration priority.

#
VirtualBus::receive

fn VirtualBus::receive(self : VirtualBus) -> Frame?

Receive and remove the highest-priority pending frame.

#
VirtualBus::set_filters

fn VirtualBus::set_filters(self : VirtualBus, filters : FilterBank) -> Unit

Replace all acceptance filters.

#
admission_rule

fn admission_rule(name : String, filter : Filter, max_payload? : Int, allow_fd? : Bool, allow_remote? : Bool, min_interval_us? : UInt64) -> AdmissionRule raise AdmissionError

Construct a policy rule.

#
analyze_trace

fn analyze_trace(trace : Trace) -> FrameAnalysis

Analyze adjacent frames in capture order.

#
append_bits

fn append_bits(target : Array[Bool], value : UInt, width : Int) -> Unit

Append a value as most-significant-bit-first bits.

#
arbitration_winner

fn arbitration_winner(frames : Array[Frame]) -> Frame?

Calculate the arbitration winner: the numerically lowest identifier wins.

#
assess_bus_health

fn assess_bus_health(metrics : FrameMetrics, dropped : Int, duration_us : UInt64, bitrate_kbps : UInt) -> BusHealth

Assess health from frame metrics and virtual-bus counters.

#
batch_frames

fn batch_frames(frames : Array[Frame], size : Int) -> Array[FrameBatch] raise BatchError

Partition frames into batches with at most size members.

#
bit_at

fn bit_at(bits : Array[Bool], position : Int) -> Bool?

Return the bit at an absolute offset, or None when outside the array.

#
bit_reader_from_bytes

fn bit_reader_from_bytes(bytes : Array[Byte]) -> BitReader

Create a reader directly from packed bytes.

#
bits_of

fn bits_of(value : UInt, width : Int) -> Array[Bool]

Convert an integer to most-significant-bit-first bits.

#
bits_to_bytes

fn bits_to_bytes(bits : Array[Bool]) -> Array[Byte]

Convert bits to packed bytes. The last byte is zero padded.

#
bits_to_string

fn bits_to_string(bits : Array[Bool]) -> String

Return a string made of 0 and 1 for diagnostics and golden tests.

#
bus_analysis_anomaly_text

fn bus_analysis_anomaly_text(anomaly : BusAnalysisAnomaly) -> String

#
bus_analysis_anomaly_variants

fn bus_analysis_anomaly_variants() -> Array[BusAnalysisAnomaly]

#
bus_analysis_mode_variants

fn bus_analysis_mode_variants() -> Array[BusAnalysisMode]

#
bus_analysis_trace

fn bus_analysis_trace(trace : Trace, channel : String, mode? : BusAnalysisMode, bitrate_kbps? : UInt) -> BusAnalysisReport

Return one report for each channel represented by a trace.

#
bus_health_name

fn bus_health_name(state : BusHealthState) -> String

#
bus_interval_percentile

fn bus_interval_percentile(intervals : Array[UInt64], percentile : Int) -> UInt64

Calculate a stable percentile from interval samples.

#
bus_observation

fn bus_observation(timestamp_us : UInt64, frame : Frame, channel? : String, sequence? : UInt) -> BusObservation

#
bus_utilization

fn bus_utilization(metrics : FrameMetrics, duration_us : UInt64, bitrate_kbps : UInt) -> Double

Calculate approximate utilization for a bitrate in kbit/s.

#
bytes_to_bits

fn bytes_to_bits(bytes : Array[Byte]) -> Array[Bool]

Convert packed bytes to high-to-low bits.

#
calculate_bit_timing

fn calculate_bit_timing(clock_hz : UInt, bitrate : UInt, sample_point_percent : Double) -> CanBitTiming raise CanTimingError

Calculate a practical timing candidate using an integer clock divider.

#
can_adapter_capabilities

fn can_adapter_capabilities(classic? : Bool, can_fd? : Bool, bitrate_switch? : Bool, listen_only? : Bool, loopback? : Bool, timestamping? : Bool, max_rx_queue? : Int, max_tx_queue? : Int) -> CanAdapterCapabilities

#
can_adapter_config

fn can_adapter_config(nominal_bitrate_kbps? : UInt, data_bitrate_kbps? : UInt, listen_only? : Bool, loopback? : Bool, receive_own? : Bool, filter? : Filter?) -> CanAdapterConfig

#
can_adapter_lifecycle_variants

fn can_adapter_lifecycle_variants() -> Array[CanAdapterLifecycle]

#
can_adapter_message

fn can_adapter_message(timestamp_us : UInt64, frame : Frame, direction_tx : Bool, sequence : UInt) -> CanAdapterMessage

#
can_fd_timing

fn can_fd_timing(nominal : CanBitTiming, data : CanBitTiming) -> CanFdTiming raise CanTimingError

#
can_frame_duration_us

fn can_frame_duration_us(frame : Frame, nominal_bitrate_kbps : UInt, data_bitrate_kbps : UInt) -> UInt64

Estimate a frame duration using the nominal and data bitrates.

#
can_line

fn can_line(timestamp_us : UInt64, frame : Frame) -> String

Encode a single compact line for shell tools.

#
can_log_from_text

fn can_log_from_text(text : String) -> CanLog raise CanTextError

Parse a log produced by CanLog::to_text.

#
canonicalize_dbc

fn canonicalize_dbc(input : String) -> String raise DbcExtendedError

Parse, validate and normalize an extended DBC document.

#
canopen_cob_id

fn canopen_cob_id(object_type : CanOpenCobType, node_id : Byte) -> UInt raise CanOpenError

Create a standard CANopen COB-ID for a node.

#
canopen_cob_name

fn canopen_cob_name(object_type : CanOpenCobType) -> String

Return the textual name of a CANopen object type.

#
canopen_device_sdo_result_variants

fn canopen_device_sdo_result_variants() -> Array[CanOpenDeviceSdoResult]

#
canopen_device_sdo_session

fn canopen_device_sdo_session(index : UInt, sub_index : Byte, upload : Bool, data : Array[Byte], block_size? : Int) -> CanOpenDeviceSdoSession

#
canopen_device_state_text

fn canopen_device_state_text(state : CanOpenDeviceState) -> String

#
canopen_device_state_variants

fn canopen_device_state_variants() -> Array[CanOpenDeviceState]

#
canopen_emergency

fn canopen_emergency(error_code : UInt, error_register : Byte, manufacturer_data : Array[Byte]) -> Array[Byte] raise CanOpenError

Build an emergency payload with standard CANopen fields.

#
canopen_heartbeat

fn canopen_heartbeat(state : Byte) -> Array[Byte]

Build a heartbeat payload.

#
canopen_heartbeat_monitor

fn canopen_heartbeat_monitor(node_id : Byte, timeout_us : UInt64) -> CanOpenHeartbeatMonitor

#
canopen_heartbeat_state_variants

fn canopen_heartbeat_state_variants() -> Array[CanOpenHeartbeatState]

#
canopen_nmt

fn canopen_nmt(command : CanOpenNmtCommand, node_id : Byte) -> Array[Byte] raise CanOpenError

Build an NMT command frame.

#
canopen_object_access_variants

fn canopen_object_access_variants() -> Array[CanOpenObjectAccess]

#
canopen_object_entry

fn canopen_object_entry(index : UInt, sub_index : Byte, name : String, access? : CanOpenObjectAccess, initial? : Array[Byte], max_length? : Int) -> CanOpenObjectEntry

#
canopen_sdo_decode

fn canopen_sdo_decode(payload : Array[Byte]) -> CanOpenSdoCommand raise CanOpenError

Decode one SDO response command.

#
canopen_sdo_download

fn canopen_sdo_download(index : UInt, sub_index : Byte, data : Array[Byte]) -> Array[Byte] raise CanOpenError

Build an expedited SDO download request.

#
canopen_sdo_download_command

fn canopen_sdo_download_command(index : UInt, sub_index : Byte, data : Array[Byte]) -> CanOpenSdoCommand raise CanOpenError

Build a typed expedited download command.

#
canopen_sdo_download_segment

fn canopen_sdo_download_segment(toggle : Bool, data : Array[Byte], last : Bool) -> CanOpenSdoCommand raise CanOpenError

Build a typed segmented download command.

#
canopen_sdo_frame

fn canopen_sdo_frame(node_id : Byte, transmit : Bool, payload : Array[Byte]) -> Frame raise CanOpenError

Build a CAN frame for an SDO payload.

#
canopen_sdo_upload

fn canopen_sdo_upload(index : UInt, sub_index : Byte) -> Array[Byte] raise CanOpenError

Build an SDO upload request.

#
canopen_sdo_upload_segment

fn canopen_sdo_upload_segment(toggle : Bool) -> CanOpenSdoCommand

Build a typed segmented upload command.

#
classify_frame

fn classify_frame(frame : Frame) -> FrameClass

Classify a frame for counters and dashboards.

#
clear_diagnostic_information

fn clear_diagnostic_information(group : UInt) -> DiagnosticRequest raise UdsError

Build a request to clear one DTC group or all groups.

#
communication_control

fn communication_control(control_type : Byte, communication_type : Byte) -> DiagnosticRequest

Build a communication-control request.

#
compare_frames

fn compare_frames(left : Frame, right : Frame) -> Int

Compare frames in the order used by deterministic arbitration.

#
compatibility_accepts

fn compatibility_accepts(matrix : CompatibilityMatrix, target : CompatibilityTarget) -> Bool

Use the matrix as an acceptance predicate for one target.

#
compatibility_add_diagnostic_requirements

fn compatibility_add_diagnostic_requirements(matrix : CompatibilityMatrix) -> Unit

Add the common minimums for a diagnostic service.

#
compatibility_add_gateway_requirements

fn compatibility_add_gateway_requirements(matrix : CompatibilityMatrix) -> Unit

Add the common minimums for a gateway deployment.

#
compatibility_add_vehicle_requirements

fn compatibility_add_vehicle_requirements(matrix : CompatibilityMatrix) -> Unit

Add the common minimums for a classical vehicle network.

#
compatibility_build_default_routes

fn compatibility_build_default_routes() -> CompatibilityRouteTable

#
compatibility_can_bridge

fn compatibility_can_bridge(target : CompatibilityTarget, protocol : CompatibilityProtocol) -> Bool

Check whether a target can be used as a bridge endpoint for a protocol.

#
compatibility_canopen_target

fn compatibility_canopen_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_ci_annotations

fn compatibility_ci_annotations(matrix : CompatibilityMatrix) -> String

Stable line-oriented output for CI annotations.

#
compatibility_classic_target

fn compatibility_classic_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_compare_targets

fn compatibility_compare_targets(source : CompatibilityTarget, destination : CompatibilityTarget) -> CompatibilityDelta

#
compatibility_default_matrix

fn compatibility_default_matrix() -> CompatibilityMatrix

#
compatibility_default_release_gate

fn compatibility_default_release_gate() -> CompatibilityReleaseGate

#
compatibility_diagnostics_matrix

fn compatibility_diagnostics_matrix() -> CompatibilityMatrix

#
compatibility_failures

fn compatibility_failures(evaluation : CompatibilityEvaluation) -> Array[CompatibilityIssue]

Return all failed requirements for a target.

#
compatibility_fd_target

fn compatibility_fd_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_forbids_feature

fn compatibility_forbids_feature(code : String, feature : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_gateway_matrix

fn compatibility_gateway_matrix() -> CompatibilityMatrix

#
compatibility_gateway_target

fn compatibility_gateway_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_inventory

fn compatibility_inventory(target : CompatibilityTarget) -> String

Describe the exact resources available to a target.

#
compatibility_isotp_target

fn compatibility_isotp_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_j1939_target

fn compatibility_j1939_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_matrix

fn compatibility_matrix(name? : String, strict? : Bool) -> CompatibilityMatrix

#
compatibility_matrix_for_target

fn compatibility_matrix_for_target(target : CompatibilityTarget, requirements : Array[CompatibilityRequirement], strict? : Bool) -> CompatibilityMatrix

Create a matrix from a single target and a reusable requirement set.

#
compatibility_minimum_bitrate

fn compatibility_minimum_bitrate(code : String, minimum : Int, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_minimum_data_bitrate

fn compatibility_minimum_data_bitrate(code : String, minimum : Int, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_minimum_identifier_bits

fn compatibility_minimum_identifier_bits(code : String, minimum : Int, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_minimum_node_capacity

fn compatibility_minimum_node_capacity(code : String, minimum : Int, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_minimum_payload

fn compatibility_minimum_payload(code : String, minimum : Int, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_protocol_is

fn compatibility_protocol_is(code : String, protocol : CompatibilityProtocol, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_protocol_text

fn compatibility_protocol_text(protocol : CompatibilityProtocol) -> String

#
compatibility_protocol_variants

fn compatibility_protocol_variants() -> Array[CompatibilityProtocol]

#
compatibility_release_gate

fn compatibility_release_gate(name? : String, minimum_score? : Int, require_all_targets? : Bool) -> CompatibilityReleaseGate

#
compatibility_remediation

fn compatibility_remediation(evaluation : CompatibilityEvaluation) -> String

Build a plain-text incident hint from a failed evaluation.

#
compatibility_requirement_kind_text

fn compatibility_requirement_kind_text(kind : CompatibilityRequirementKind) -> String

#
compatibility_requirement_kind_variants

fn compatibility_requirement_kind_variants() -> Array[CompatibilityRequirementKind]

#
compatibility_requires_classic

fn compatibility_requires_classic(code : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_requires_diagnostics

fn compatibility_requires_diagnostics(code : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_requires_fd

fn compatibility_requires_fd(code : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_requires_feature

fn compatibility_requires_feature(code : String, feature : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_requires_isotp

fn compatibility_requires_isotp(code : String, description? : String, severity? : CompatibilitySeverity) -> CompatibilityRequirement

#
compatibility_route

fn compatibility_route(source : CompatibilityTarget, destination : CompatibilityTarget, transport : CompatibilityProtocol) -> CompatibilityRoute

#
compatibility_route_payload_budget

fn compatibility_route_payload_budget(route : CompatibilityRoute) -> Int

Produce a bounded payload size for a route, reserving a byte for framing when needed.

#
compatibility_route_table

fn compatibility_route_table() -> CompatibilityRouteTable

#
compatibility_schema_version

fn compatibility_schema_version() -> String

Stable schema version for compatibility snapshots.

#
compatibility_severity_text

fn compatibility_severity_text(severity : CompatibilitySeverity) -> String

#
compatibility_severity_variants

fn compatibility_severity_variants() -> Array[CompatibilitySeverity]

#
compatibility_snapshot

fn compatibility_snapshot(matrix : CompatibilityMatrix) -> String

A compact machine-readable snapshot for logging and support bundles.

#
compatibility_standard_target_matrix

fn compatibility_standard_target_matrix(target : CompatibilityTarget) -> CompatibilityMatrix

Construct a standard acceptance matrix for one target.

#
compatibility_target

fn compatibility_target(name : String, protocol : CompatibilityProtocol, nominal_bitrate : Int, data_bitrate : Int, max_payload : Int, identifier_bits : Int, node_capacity : Int, features? : Array[String], notes? : String) -> CompatibilityTarget

#
compatibility_target_fingerprint

fn compatibility_target_fingerprint(target : CompatibilityTarget) -> UInt64

Return a deterministic checksum-like fingerprint for a target.

#
compatibility_targets_for_protocol

fn compatibility_targets_for_protocol(protocol : CompatibilityProtocol) -> Array[CompatibilityTarget]

Build a target set from a requested protocol family.

#
compatibility_uds_target

fn compatibility_uds_target(name? : String, node_capacity? : Int) -> CompatibilityTarget

#
compatibility_warnings

fn compatibility_warnings(evaluation : CompatibilityEvaluation) -> Array[CompatibilityIssue]

Return all warnings for a target.

#
count_stuffed_bits

fn count_stuffed_bits(bits : Array[Bool]) -> Int

Count stuffed bits in a sequence without allocating the stuffed result.

#
counter_is_next

fn counter_is_next(previous : Byte, current : Byte) -> Bool

Verify the expected modulo-16 counter progression.

#
counter_nibble

fn counter_nibble(data : Array[Byte], offset : Int, high_nibble : Bool) -> Byte raise PayloadError

Read a rolling counter nibble.

#
crc15

fn crc15(bits : Array[Bool]) -> UInt

CRC-15 used by the classical CAN frame format.

#
crc17

fn crc17(bits : Array[Bool]) -> UInt

CRC-17 used by CAN-FD frames with a payload up to 16 bytes.

#
crc21

fn crc21(bits : Array[Bool]) -> UInt

CRC-21 used by CAN-FD frames with a payload above 16 bytes.

#
crc8_autosar

fn crc8_autosar(data : Array[Byte], initial : Byte) -> Byte

Return the CRC-8/AUTOSAR checksum with configurable initial value.

#
crc8_sae_j1850

fn crc8_sae_j1850(data : Array[Byte]) -> Byte

Return the CRC-8/SAE-J1850 checksum of a payload.

#
data_frame

fn data_frame(id : UInt, data : Array[Byte], extended? : Bool) -> Frame raise FrameError

Create a classic CAN data frame.

#
dbc_codegen

fn dbc_codegen(messages : Array[Message], options : DbcCodegenOptions) -> DbcGeneratedArtifact

Generate an artifact for a collection of DBC messages.

#
dbc_codegen_all_targets

fn dbc_codegen_all_targets(messages : Array[Message], module_name : String) -> Array[DbcGeneratedArtifact]

Produce one artifact per supported target.

#
dbc_codegen_identifier

fn dbc_codegen_identifier(name : String) -> String

Render a safe identifier for generated code.

#
dbc_codegen_lint

fn dbc_codegen_lint(messages : Array[Message]) -> Array[String]

Lint a DBC schema for issues that affect generated integration code.

#
dbc_codegen_options

fn dbc_codegen_options(target? : DbcCodegenTarget, module_name? : String, include_comments? : Bool, include_validation? : Bool, line_ending? : String) -> DbcCodegenOptions

#
dbc_codegen_report

fn dbc_codegen_report(messages : Array[Message]) -> String

Return a deterministic schema report suitable for CI.

#
dbc_codegen_target_name

fn dbc_codegen_target_name(target : DbcCodegenTarget) -> String

#
dbc_codegen_target_variants

fn dbc_codegen_target_variants() -> Array[DbcCodegenTarget]

#
dbc_codegen_total_lines

fn dbc_codegen_total_lines(artifacts : Array[DbcGeneratedArtifact]) -> Int

Return the total generated source size across artifacts.

#
dbc_codegen_workspace

fn dbc_codegen_workspace(workspace : DbcWorkspace, options : DbcCodegenOptions) -> DbcGeneratedArtifact

Generate a DBC workspace artifact without mutating its schema.

#
dbc_workspace_binding

fn dbc_workspace_binding(name : String, message : Message, selector? : DbcWorkspaceMuxSelector, extended? : Bool) -> DbcWorkspaceBinding

#
dbc_workspace_from_text

fn dbc_workspace_from_text(input : String) -> DbcWorkspace raise DbcError

Create a workspace from a parsed DBC document.

#
dbc_workspace_issue_text

fn dbc_workspace_issue_text(issue : DbcWorkspaceIssue) -> String

#
dbc_workspace_issue_variants

fn dbc_workspace_issue_variants() -> Array[DbcWorkspaceIssue]

#
dbc_workspace_mux_accepts

fn dbc_workspace_mux_accepts(selector : DbcWorkspaceMuxSelector, value : UInt) -> Bool

Return whether a mux selector accepts a value.

#
dbc_workspace_mux_variants

fn dbc_workspace_mux_variants() -> Array[DbcWorkspaceMuxSelector]

#
dbc_workspace_signal_group

fn dbc_workspace_signal_group(name : String, message_id : UInt, signals? : Array[Signal]) -> DbcWorkspaceSignalGroup

#
dbc_workspace_value

fn dbc_workspace_value(name : String, value : Double) -> DbcWorkspaceValue

#
dbc_workspace_values

fn dbc_workspace_values(names : Array[String], values : Array[Double]) -> DbcWorkspaceValueSet

Build a value set from parallel signal names and values.

#
decode_canopen_cob_id

fn decode_canopen_cob_id(identifier : UInt) -> CanOpenCobId raise CanOpenError

Decode a standard CANopen COB-ID using the conventional ranges.

#
decode_frame

fn decode_frame(bytes : Array[Byte]) -> Frame raise FrameCodecError

Decode one frame from the stable binary representation.

#
decode_frame_batch

fn decode_frame_batch(bytes : Array[Byte]) -> FrameBatch raise BatchError

Decode a batch archive and check its checksum.

#
decode_j1939

fn decode_j1939(id : UInt) -> J1939Id

Decode the fields of a J1939 identifier.

#
decode_j1939_frame

fn decode_j1939_frame(frame : Frame) -> J1939Message? raise J1939Error

Decode an extended CAN data frame as a J1939 message.

#
decode_response

fn decode_response(request : DiagnosticRequest, payload : Array[Byte]) -> DiagnosticResponse

Decode a UDS response payload.

#
decode_wire_can20

fn decode_wire_can20(bits : Array[Bool]) -> Frame raise WireCodecError

Decode a classic CAN wire sequence produced by encode_wire.

#
decode_wire_canfd

fn decode_wire_canfd(bits : Array[Bool]) -> Frame raise WireCodecError

Decode a CAN-FD wire sequence produced by encode_wire.

#
default_diagnostic_session

fn default_diagnostic_session() -> DiagnosticSessionProfile

Return the default session profile used by a tester.

#
destuff

fn destuff(bits : Array[Bool]) -> Array[Bool] raise WireError

Remove CAN bit stuffing from a received bit sequence.

#
diagnostic_addressing_modes

fn diagnostic_addressing_modes() -> Array[DiagnosticAddressingMode]

Construct the addressing modes accepted by the portable transport layer.

#
diagnostic_data_identifier

fn diagnostic_data_identifier(identifier : UInt, name : String, length : Int, readable? : Bool, writable? : Bool, initial? : Array[Byte]) -> DiagnosticDataIdentifier

Create a data identifier entry.

#
diagnostic_dtc_queries

fn diagnostic_dtc_queries() -> Array[DtcQuery]

Construct representative selectors for a diagnostic UI.

#
diagnostic_event

fn diagnostic_event(timestamp_us : UInt64, request : DiagnosticRequest, response : Array[Byte], duration_us : UInt64) -> DiagnosticEvent

#
diagnostic_frame

fn diagnostic_frame(request : DiagnosticRequest, id : UInt, extended? : Bool) -> Frame raise FrameError

Return a service request encoded as a CAN data frame.

#
diagnostic_identification_workflow

fn diagnostic_identification_workflow(identifiers : Array[UInt]) -> DiagnosticWorkflow

Build a standard ECU identification workflow.

#
diagnostic_keepalive_deadline

fn diagnostic_keepalive_deadline(profile : DiagnosticSessionProfile, now_us : UInt64) -> UInt64

Return the next TesterPresent deadline.

#
diagnostic_readiness

fn diagnostic_readiness(session_ok : Bool, security_ok : Bool, voltage_ok : Bool, temperature_ok : Bool, dtc_ok : Bool) -> DiagnosticReadiness

#
diagnostic_readiness_all

fn diagnostic_readiness_all(checks : Array[DiagnosticReadiness]) -> DiagnosticReadiness

Aggregate the outcome of multiple readiness checks.

#
diagnostic_retry_policy

fn diagnostic_retry_policy(max_attempts? : Int, backoff_us? : UInt64, retry_negative? : Bool) -> DiagnosticRetryPolicy

#
diagnostic_session_kinds

fn diagnostic_session_kinds() -> Array[DiagnosticSessionKind]

Construct all standard session variants for capability discovery.

#
diagnostic_session_name

fn diagnostic_session_name(kind : DiagnosticSessionKind) -> String

Return a stable session name for reports.

#
diagnostic_session_profile

fn diagnostic_session_profile(kind : DiagnosticSessionKind, p2_server_us : UInt64, p2_star_server_us : UInt64, s3_server_us : UInt64, addressing? : DiagnosticAddressingMode, security_level? : Byte) -> DiagnosticSessionProfile

Create a standard diagnostic session profile.

#
diagnostic_session_requires_keepalive

fn diagnostic_session_requires_keepalive(profile : DiagnosticSessionProfile) -> Bool

Return whether the session should be kept alive by TesterPresent.

#
diagnostic_trouble_code

fn diagnostic_trouble_code(code : UInt, status : Byte, severity? : Byte, snapshot? : Array[Byte], extended_data? : Array[Byte], timestamp_us? : UInt64) -> DiagnosticTroubleCode

Create a diagnostic trouble code record.

#
diagnostic_workflow_state_text

fn diagnostic_workflow_state_text(state : DiagnosticWorkflowState) -> String

#
diagnostic_workflow_state_variants

fn diagnostic_workflow_state_variants() -> Array[DiagnosticWorkflowState]

#
diagnostic_workflow_step

fn diagnostic_workflow_step(name : String, request : DiagnosticRequest, timeout_us? : UInt64, retry? : DiagnosticRetryPolicy) -> DiagnosticWorkflowStep

#
diff_dbc_schema

fn diff_dbc_schema(before : Array[Message], after : Array[Message]) -> Array[DbcSchemaChange]

Compare message collections by identifier and canonical schema text.

#
dtc_matches

fn dtc_matches(dtc : DiagnosticTroubleCode, query : DtcQuery) -> Bool

Return whether a DTC matches a query selector.

#
dtc_record

fn dtc_record(code : UInt, status : Byte, occurrence? : UInt, snapshot? : Array[Byte]) -> DtcRecord raise DtcCodecError

Create a DTC record with an optional occurrence counter and snapshot.

#
ecu_memory_permission_variants

fn ecu_memory_permission_variants() -> Array[EcuMemoryPermission]

#
ecu_memory_region

fn ecu_memory_region(start : UInt, length : Int, permission? : EcuMemoryPermission) -> EcuMemoryRegion raise EcuMemoryError

Create a zero-initialized ECU memory region.

#
ecu_request_outcome_variants

fn ecu_request_outcome_variants() -> Array[EcuRequestOutcome]

#
ecu_reset

fn ecu_reset(reset_type : Byte) -> DiagnosticRequest

Build an ECU reset request.

#
ecu_reset_kind_variants

fn ecu_reset_kind_variants() -> Array[EcuResetKind]

#
ecu_security_policy

fn ecu_security_policy(level : Byte, secret : UInt, max_attempts? : Int, delay_us? : UInt64) -> EcuSecurityPolicy

#
ecu_security_state_variants

fn ecu_security_state_variants() -> Array[EcuSecurityState]

#
encode_bits

fn encode_bits(frame : Frame) -> Array[Bool]

Encode a frame's arbitration and control fields before CRC.

#
encode_dtc_record

fn encode_dtc_record(record : DtcRecord) -> Array[Byte]

Encode the four-byte DTC record used in a UDS response.

#
encode_dtc_report

fn encode_dtc_report(report : DtcReport) -> Array[Byte]

Encode a report while preserving record order.

#
encode_frame

fn encode_frame(frame : Frame) -> Array[Byte]

A stable binary representation for trace files and test fixtures.

The format is: version, flags, four-byte identifier, payload length, data. All multi-byte values are big-endian so the format is identical on every MoonBit backend.

#
encode_j1939

fn encode_j1939(value : J1939Id) -> UInt

Encode a J1939 identifier from its fields.

#
encode_wire

fn encode_wire(frame : Frame) -> Array[Bool]

Encode identifier, control, data, CRC, stuffing and EOF bits.

#
encoded_wire_length

fn encoded_wire_length(frame : Frame) -> Int

Return the stuffed frame length, including SOF-free EOF bits.

#
error_frame

fn error_frame(code : Byte) -> Frame

Create a local error frame for simulation and diagnostics.

#
estimate_transmission_us

fn estimate_transmission_us(frame : Frame, arbitration_kbps : UInt, data_kbps : UInt) -> UInt64

Estimate transmission time in microseconds.

#
exact_filter

fn exact_filter(id : UInt, extended? : Bool) -> Filter

Match an exact identifier.

#
extended_diagnostic_session

fn extended_diagnostic_session() -> DiagnosticSessionProfile

Return an extended diagnostic session profile.

#
fd_frame

fn fd_frame(id : UInt, data : Array[Byte], extended? : Bool, bitrate_switch? : Bool, error_state_indicator? : Bool) -> Frame raise FrameError

Create a CAN-FD data frame.

#
fd_frame_duration_ns

fn fd_frame_duration_ns(frame : Frame, timing : CanFdTiming) -> UInt64

Estimate the data-phase duration for a CAN-FD frame with BRS.

#
fd_length_from_dlc

fn fd_length_from_dlc(dlc : Byte) -> Int

Decode a CAN-FD DLC into its payload capacity.

#
filter_bank_is_valid

fn filter_bank_is_valid(bank : FilterBank) -> Bool

Return whether all filters in a bank are valid.

#
filter_is_valid

fn filter_is_valid(filter : Filter) -> Bool

Validate a filter against the selected identifier width.

#
frame_batch

fn frame_batch(sequence : UInt, frames : Array[Frame]) -> FrameBatch raise BatchError

#
frame_class_name

fn frame_class_name(class : FrameClass) -> String

Return the frame class as a stable text label.

#
frame_crc

fn frame_crc(frame : Frame) -> UInt

Return the CRC for the unstuffed arbitration/control/data sequence.

#
frame_duration_ns

fn frame_duration_ns(frame : Frame, timing : CanBitTiming) -> UInt64

Estimate a frame's nominal-only transmission duration.

#
frame_encoded_size

fn frame_encoded_size(frame : Frame) -> Int

Return the number of encoded frame bytes, including the codec header.

#
frame_equal

fn frame_equal(left : Frame, right : Frame) -> Bool

Compare frame payloads and all control flags.

#
frame_from_hex

fn frame_from_hex(text : String) -> Frame raise FrameCodecError

Decode a hexadecimal frame representation.

#
frame_is_valid

fn frame_is_valid(frame : Frame) -> Bool

Return whether a frame passes all normalized invariants.

#
frame_metrics

fn frame_metrics(frames : Array[Frame]) -> FrameMetrics

Calculate deterministic metrics without changing the input order.

#
frame_pipeline_action_variants

fn frame_pipeline_action_variants() -> Array[FramePipelineAction]

#
frame_pipeline_result_variants

fn frame_pipeline_result_variants() -> Array[FramePipelineResult]

#
frame_pipeline_rule

fn frame_pipeline_rule(name : String, filter : Filter, action : FramePipelineAction, max_payload? : Int, allow_fd? : Bool) -> FramePipelineRule raise FramePipelineError

#
frame_summary

fn frame_summary(frame : Frame) -> String

Return a compact human-readable frame summary.

#
frame_to_hex

fn frame_to_hex(frame : Frame) -> String

Encode a frame as lowercase hexadecimal bytes.

#
frame_violation_message

fn frame_violation_message(violation : FrameViolation) -> String

Return a diagnostic description for a validation finding.

#
frame_wire_bits

fn frame_wire_bits(frame : Frame) -> Int

Return the approximate wire bit count before inter-frame spacing.

#
frame_with_data

fn frame_with_data(frame : Frame, data : Array[Byte]) -> Frame raise PayloadError

Rebuild a frame with a defensive payload copy.

#
frame_with_id

fn frame_with_id(frame : Frame, id : UInt) -> Frame raise PayloadError

Rebuild a frame with a different arbitration identifier.

#
frames_per_second

fn frames_per_second(metrics : FrameMetrics, duration_us : UInt64) -> Double

Calculate frames per second over an observation interval.

#
gateway_pair

fn gateway_pair(left_to_right : CanGateway, right_to_left : CanGateway) -> GatewayPair

#
gateway_policy_context

fn gateway_policy_context(timestamp_us : UInt64, source_channel : String, destination_channel : String, frame : Frame) -> GatewayPolicyContext

#
gateway_policy_decision_text

fn gateway_policy_decision_text(decision : GatewayPolicyDecision) -> String

Return a stable policy decision label.

#
gateway_policy_decision_variants

fn gateway_policy_decision_variants() -> Array[GatewayPolicyDecision]

#
gateway_policy_error_variants

fn gateway_policy_error_variants() -> Array[GatewayPolicyError]

#
gateway_policy_pair

fn gateway_policy_pair(left : GatewayPolicyEngine, right : GatewayPolicyEngine, source : String, destination : String, timestamp_us : UInt64, frame : Frame) -> Frame?

Evaluate one frame against a pair of channel-specific engines.

#
gateway_policy_rule

fn gateway_policy_rule(name : String, filter : Filter, output_id? : UInt?, prefix? : Array[Byte], max_payload? : Int, min_interval_us? : UInt64, allow_remote? : Bool) -> GatewayPolicyRule raise GatewayPolicyError

#
isotp_channel

fn isotp_channel(source_id : UInt, target_id : UInt, extended? : Bool, addressing? : IsoTpSessionAddressing, flow_control? : IsoTpFlowControlConfig) -> IsoTpChannel

#
isotp_config

fn isotp_config(frame_bytes? : Int, block_size? : Byte, separation_time? : Byte) -> IsoTpConfig raise IsoTpError

Create an ISO-TP configuration. Data capacity is normally 8 or 64 bytes.

#
isotp_decode

fn isotp_decode(packet : Array[Byte]) -> IsoTpPacket?

Decode one ISO-TP packet.

#
isotp_decode_checked

fn isotp_decode_checked(packet : Array[Byte], config : IsoTpConfig) -> IsoTpPacket raise IsoTpError

Decode a packet while enforcing its declared payload length.

#
isotp_flow_control_config

fn isotp_flow_control_config(block_size : Int, separation_time_us : UInt64, wait_frame_limit : Int, max_payload : Int) -> IsoTpFlowControlConfig

Create flow-control parameters with safe bounds.

#
isotp_frames

fn isotp_frames(tx_id : UInt, payload : Array[Byte], config : IsoTpConfig, extended? : Bool) -> Array[Frame] raise IsoTpError

Wrap ISO-TP packets in CAN or CAN-FD data frames.

#
isotp_reassemble

fn isotp_reassemble(first : IsoTpPacket, rest : Array[IsoTpPacket]) -> Array[Byte]?

Reassemble consecutive ISO-TP packets after a first frame.

#
isotp_reassemble_checked

fn isotp_reassemble_checked(packets : Array[IsoTpPacket]) -> Array[Byte] raise IsoTpError

Reassemble a complete ISO-TP transfer and verify sequence numbers.

#
isotp_reassemble_frames

fn isotp_reassemble_frames(frames : Array[Frame], config : IsoTpConfig) -> Array[Byte] raise IsoTpError

Decode and reassemble a sequence of CAN data frames.

#
isotp_receiver_result_variants

fn isotp_receiver_result_variants() -> Array[IsoTpReceiverResult]

Construct representative receiver results.

#
isotp_segment

fn isotp_segment(payload : Array[Byte]) -> Array[Array[Byte]]

Encode a payload into ISO-TP packets carried by classic CAN frames.

#
isotp_segment_checked

fn isotp_segment_checked(payload : Array[Byte], config : IsoTpConfig) -> Array[Array[Byte]] raise IsoTpError

Segment a payload while respecting frame size and the 12-bit classic length.

#
isotp_session_addressing_variants

fn isotp_session_addressing_variants() -> Array[IsoTpSessionAddressing]

Construct all portable ISO-TP addressing formats.

#
isotp_transfer_summary

fn isotp_transfer_summary(transmitter : IsoTpTransmitter, receiver : IsoTpStreamReceiver) -> String

Return a stable transfer summary for diagnostics.

#
isotp_transmitter_state_variants

fn isotp_transmitter_state_variants() -> Array[IsoTpTransmitterState]

Construct every transmitter state for state-machine tools.

#
j1939_address_claim

fn j1939_address_claim(source_address : Byte, name : UInt64, manufacturer : UInt, function : Byte, instance : Byte, timestamp_us? : UInt64) -> J1939AddressClaim

#
j1939_bam

fn j1939_bam(pgn : UInt, payload : Array[Byte]) -> Array[Array[Byte]] raise J1939Error

Build a J1939 BAM transport-protocol announcement.

#
j1939_decode_spns

fn j1939_decode_spns(definitions : Array[J1939SpnDefinition], data : Array[Byte]) -> Array[(UInt, Double)]

Decode multiple configured SPNs from a PGN payload.

#
j1939_destination

fn j1939_destination(identifier : J1939Id) -> Byte

Return the numeric destination address, or broadcast for PDU2 messages.

#
j1939_id

fn j1939_id(priority : Byte, data_page : Bool, pdu_format : Byte, pdu_specific : Byte, source_address : Byte) -> J1939Id

Create a J1939 identifier from its wire fields.

#
j1939_matches_pgn

fn j1939_matches_pgn(identifier : J1939Id, pgn : UInt) -> Bool

Test whether a J1939 identifier belongs to a PGN.

#
j1939_message

fn j1939_message(identifier : J1939Id, payload : Array[Byte]) -> J1939Message raise J1939Error

#
j1939_parse_bam

fn j1939_parse_bam(announcement : Array[Byte]) -> (Int, Int, UInt)?

Parse a BAM announcement as (length, packet_count, pgn).

#
j1939_reassemble_bam

fn j1939_reassemble_bam(packets : Array[Array[Byte]], total_length : Int) -> Array[Byte] raise J1939Error

Reassemble BAM data packets after validating their sequence numbers.

#
j1939_spn

fn j1939_spn(spn : UInt, name : String, start_bit : Int, length : Int, factor? : Double, offset? : Double, minimum? : Double, maximum? : Double, unit? : String) -> J1939SpnDefinition

#
j1939_transport_direction_variants

fn j1939_transport_direction_variants() -> Array[J1939TransportDirection]

#
j1939_transport_state_variants

fn j1939_transport_state_variants() -> Array[J1939TransportState]

#
j1939_with_priority

fn j1939_with_priority(identifier : J1939Id, priority : Byte) -> J1939Id raise J1939Error

Return a priority-adjusted arbitration identifier.

#
j1939_with_source

fn j1939_with_source(identifier : J1939Id, source : Byte) -> J1939Id raise J1939Error

Return a source-address-adjusted identifier.

#
locked_uds_session

fn locked_uds_session(p2_timeout_us? : UInt64) -> UdsSession

Create a session that requires security access for protected services.

#
mask_filter

fn mask_filter(id : UInt, mask : UInt, extended? : Bool?) -> Filter

Match identifier bits selected by a mask.

#
mask_payload

fn mask_payload(data : Array[Byte], offset : Int, mask : Byte) -> Array[Byte] raise PayloadError

Mask a payload byte range without changing its length.

#
matching_filters

fn matching_filters(bank : FilterBank, frame : Frame) -> Array[Filter]

Return all filters that match a frame.

#
max_payload

fn max_payload(protocol : Protocol) -> Int

Return the maximum payload allowed by the protocol.

#
merge_traces

fn merge_traces(left : Trace, right : Trace) -> Trace

Merge two traces and normalize their ordering.

#
message

fn message(id : UInt, name : String, dlc : Int) -> Message

Create a message definition.

#
network_error_budget

fn network_error_budget(max_error_rate? : Double, max_drop_rate? : Double, max_offline_nodes? : Int) -> NetworkErrorBudget

#
network_node_health

fn network_node_health(node_id : Byte, name : String, timeout_us? : UInt64) -> NetworkNodeHealth

#
network_node_health_state_text

fn network_node_health_state_text(state : NetworkNodeHealthState) -> String

#
network_node_health_state_variants

fn network_node_health_state_variants() -> Array[NetworkNodeHealthState]

#
new_admission_policy

fn new_admission_policy() -> AdmissionPolicy

#
new_bit_reader

fn new_bit_reader(bits : Array[Bool]) -> BitReader

Create a reader over a defensive copy of the input bits.

#
new_bit_writer

fn new_bit_writer() -> BitWriter

Create an empty bit writer.

#
new_bus

fn new_bus(capacity : Int) -> VirtualBus

Create a bus. A zero capacity means an unbounded queue.

#
new_bus_analyzer

fn new_bus_analyzer(mode : BusAnalysisMode, channel? : String, bitrate_kbps? : UInt, burst_window_us? : UInt64, jitter_limit_us? : UInt64) -> BusAnalyzer

#
new_can_adapter_hub

fn new_can_adapter_hub() -> CanAdapterHub

#
new_can_adapter_stats

fn new_can_adapter_stats() -> CanAdapterStats

#
new_can_log

fn new_can_log() -> CanLog

#
new_can_network

fn new_can_network(timeout_us? : UInt64, queue_capacity? : Int) -> CanNetwork raise QueueError

Create a network. A zero timeout disables automatic offline detection.

#
new_can_port

fn new_can_port(name : String, capabilities? : CanAdapterCapabilities) -> CanPort

#
new_canopen_device

fn new_canopen_device(node_id : Byte, name : String, heartbeat_timeout_us? : UInt64) -> CanOpenDevice

#
new_canopen_device_network

fn new_canopen_device_network() -> CanOpenDeviceNetwork

#
new_canopen_object_dictionary

fn new_canopen_object_dictionary(capacity? : Int) -> CanOpenObjectDictionary

#
new_dbc_database

fn new_dbc_database() -> DbcDatabase

Create an empty database.

#
new_dbc_workspace

fn new_dbc_workspace() -> DbcWorkspace

#
new_dbc_workspace_value_set

fn new_dbc_workspace_value_set() -> DbcWorkspaceValueSet

#
new_diagnostic_data_table

fn new_diagnostic_data_table() -> DiagnosticDataTable

#
new_diagnostic_exchange_log

fn new_diagnostic_exchange_log() -> DiagnosticExchangeLog

#
new_diagnostic_trouble_code_store

fn new_diagnostic_trouble_code_store(capacity : Int) -> DiagnosticTroubleCodeStore

Create an empty bounded DTC store.

#
new_diagnostic_workflow

fn new_diagnostic_workflow() -> DiagnosticWorkflow

#
new_dtc_report

fn new_dtc_report(subfunction : Byte, status_availability_mask : Byte, records : Array[DtcRecord]) -> DtcReport

Construct a report for a positive ReadDTCInformation response.

#
new_dtc_store

fn new_dtc_store(capacity : Int) -> DtcStore raise DtcCodecError

#
new_ecu_endpoint

fn new_ecu_endpoint(address : UInt, name : String, security? : EcuSecurityPolicy) -> EcuEndpoint

Create an ECU endpoint with empty data, DTC and memory tables.

#
new_ecu_fleet

fn new_ecu_fleet() -> EcuFleet

#
new_ecu_memory_map

fn new_ecu_memory_map() -> EcuMemoryMap

#
new_filter_bank

fn new_filter_bank() -> FilterBank

Create an empty filter bank.

#
new_filter_index

fn new_filter_index(bank : FilterBank) -> FilterIndex

#
new_frame_deduplicator

fn new_frame_deduplicator(window_us? : UInt64) -> FrameDeduplicator

#
new_frame_pipeline

fn new_frame_pipeline(capacity? : Int) -> FramePipeline

#
new_frame_pipeline_window

fn new_frame_pipeline_window(duration_us : UInt64) -> FramePipelineWindow

#
new_frame_queue

fn new_frame_queue(capacity : Int) -> FrameQueue raise QueueError

Create a queue. Capacity zero means unlimited buffering.

#
new_frame_rate_limiter

fn new_frame_rate_limiter() -> FrameRateLimiter

#
new_gateway

fn new_gateway() -> CanGateway

Create an empty gateway.

#
new_gateway_policy_engine

fn new_gateway_policy_engine(capacity? : Int) -> GatewayPolicyEngine

#
new_isotp_receiver

fn new_isotp_receiver(config : IsoTpConfig) -> IsoTpReceiver

#
new_isotp_router

fn new_isotp_router() -> IsoTpRouter

#
new_isotp_session

fn new_isotp_session(flow_control : IsoTpFlowControlConfig, timeout_us : UInt64) -> IsoTpSession

#
new_isotp_stream_receiver

fn new_isotp_stream_receiver(flow_control : IsoTpFlowControlConfig, timeout_us : UInt64) -> IsoTpStreamReceiver

#
new_isotp_transmitter

fn new_isotp_transmitter(payload : Array[Byte], flow_control : IsoTpFlowControlConfig, started_us : UInt64) -> IsoTpTransmitter

Create a transmitter for a bounded payload.

#
new_j1939_address_manager

fn new_j1939_address_manager(timeout_us? : UInt64) -> J1939AddressManager

#
new_j1939_transport_session

fn new_j1939_transport_session(pgn : UInt, direction : J1939TransportDirection, timeout_us? : UInt64) -> J1939TransportSession

#
new_latency_window

fn new_latency_window(capacity : Int) -> LatencyWindow raise LatencyError

#
new_network_health_tracker

fn new_network_health_tracker(budget? : NetworkErrorBudget) -> NetworkHealthTracker

#
new_node_registry

fn new_node_registry() -> NodeRegistry

#
new_payload_codec

fn new_payload_codec(options? : PayloadCodecOptions) -> PayloadCodec

#
new_pdo_mapping

fn new_pdo_mapping(payload_bytes? : Int) -> PdoMapping raise PdoError

#
new_scheduler

fn new_scheduler() -> CanScheduler

#
new_simulation

fn new_simulation(capacity : Int, bitrate_kbps : UInt) -> Simulation

Create a simulation with a bounded or unbounded receive queue.

#
new_simulation_scenario

fn new_simulation_scenario(name : String, capacity? : Int, bitrate_kbps? : UInt) -> SimulationScenario

#
new_trace

fn new_trace() -> Trace

Create an empty trace.

#
new_trace_exporter

fn new_trace_exporter(options? : TraceExportOptions) -> TraceExporter

#
new_trace_query

fn new_trace_query() -> TraceQuerySpec

#
new_uds_session

fn new_uds_session(p2_timeout_us? : UInt64) -> UdsSession

#
parse_can_line

fn parse_can_line(line : String) -> (UInt64, Frame) raise CanTextError

Parse a compact two-field line.

#
parse_dbc

fn parse_dbc(input : String) -> Array[Message] raise DbcError

Parse the message/signal subset commonly used by simulation tools.

#
parse_dbc_database

fn parse_dbc_database(input : String) -> DbcDatabase raise DbcError

Build a database using the existing DBC subset parser.

#
parse_dbc_extended

fn parse_dbc_extended(input : String) -> DbcParseReport raise DbcExtendedError

Parse common factor, offset, range and unit fields in SG_ records.

#
parse_dtc_report

fn parse_dtc_report(payload : Array[Byte]) -> DtcReport raise DtcCodecError

Parse a positive ReadDTCInformation response.

#
parse_uds_response

fn parse_uds_response(request : DiagnosticRequest, payload : Array[Byte]) -> UdsResponseInfo raise UdsError

Parse a response and preserve the original payload for callers.

#
payload_codec_checksum

fn payload_codec_checksum(data : Array[Byte], excluded : Int) -> Byte

Compute an additive checksum excluding one byte position.

#
payload_codec_counter_valid

fn payload_codec_counter_valid(previous : Byte, current : Byte, modulus : Int) -> Bool

Validate a counter sequence against a modulus.

#
payload_codec_crc

fn payload_codec_crc(data : Array[Byte]) -> Byte

Compute a CRC over a payload prefix.

#
payload_codec_layout_valid

fn payload_codec_layout_valid(options : PayloadCodecOptions) -> Bool

Return whether a payload layout is internally consistent.

#
payload_codec_options

fn payload_codec_options(profile? : PayloadCodecProfile, counter_offset? : Int, counter_high_nibble? : Bool, crc_offset? : Int, checksum_offset? : Int, expected_length? : Int, counter_modulus? : Int) -> PayloadCodecOptions

#
payload_codec_pack_counter

fn payload_codec_pack_counter(payload : Array[Byte], counter : Byte, offset : Int, high_nibble : Bool) -> Array[Byte] raise PayloadError

Pack a sequence counter and payload into a fixed-length frame payload.

#
payload_codec_profile_text

fn payload_codec_profile_text(profile : PayloadCodecProfile) -> String

#
payload_codec_profile_variants

fn payload_codec_profile_variants() -> Array[PayloadCodecProfile]

#
payload_codec_report

fn payload_codec_report(codec : PayloadCodec) -> String

Produce a stable codec health report.

#
payload_codec_status_text

fn payload_codec_status_text(status : PayloadCodecStatus) -> String

#
payload_codec_status_variants

fn payload_codec_status_variants() -> Array[PayloadCodecStatus]

#
payload_set_uint

fn payload_set_uint(data : Array[Byte], offset : Int, width : Int, value : UInt, order : ByteOrder) -> Array[Byte] raise PayloadError

Insert an unsigned integer into a copied payload.

#
payload_uint

fn payload_uint(data : Array[Byte], offset : Int, width : Int, order : ByteOrder) -> UInt raise PayloadError

Extract an unsigned integer from a payload.

#
pdo_frame

fn pdo_frame(node_id : Byte, transmit_number : Byte, data : Array[Byte]) -> Frame raise PdoError

Build a PDO frame with the standard 11-bit COB-ID.

#
pgn

fn pgn(number : UInt, name : String, data_length : Int) -> Pgn

Describe a PGN for higher-level applications.

#
process_frame_batch

fn process_frame_batch(pipeline : FramePipeline, limiter : FrameRateLimiter, frames : Array[(UInt64, Frame)]) -> Array[Frame]

Run a pipeline and rate limiter together over a timestamped batch.

#
programming_diagnostic_session

fn programming_diagnostic_session() -> DiagnosticSessionProfile

Return a programming session profile.

#
read_data

fn read_data(identifier : UInt) -> DiagnosticRequest

Build a read-data-by-identifier request.

#
read_dtc_information

fn read_dtc_information(subfunction : Byte, mask : Byte) -> DiagnosticRequest

Build a DTC information request.

#
read_memory

fn read_memory(address : UInt, length : UInt, address_bytes? : Int, length_bytes? : Int) -> DiagnosticRequest raise UdsError

Build a memory read request using a compact address/length format.

#
remote_frame

fn remote_frame(id : UInt, extended? : Bool) -> Frame raise FrameError

Create a remote request frame.

#
request_download

fn request_download(data_format : Byte, address : UInt, length : UInt, address_bytes? : Int, length_bytes? : Int) -> DiagnosticRequest raise UdsError

Build a request-download command.

#
request_transfer_exit

fn request_transfer_exit(data? : Array[Byte]) -> DiagnosticRequest

#
reverse_payload

fn reverse_payload(data : Array[Byte], start : Int, end : Int) -> Array[Byte] raise PayloadError

Return a payload with bytes reversed in a selected range.

#
route_batch

fn route_batch(gateway : CanGateway, frames : Array[Frame]) -> Array[RoutedFrame] raise RoutingError

Route a batch and keep only successfully forwarded frames.

#
route_rule

fn route_rule(name : String, filter : Filter, output_id? : UInt?, output_extended? : Bool?, prefix? : Array[Byte], strip_prefix? : Int) -> RouteRule raise RoutingError

Construct a route rule with optional identifier and payload rewrites.

#
routine_control

fn routine_control(routine_type : Byte, identifier : UInt, data? : Array[Byte]) -> DiagnosticRequest raise UdsError

Build a routine-control request with an optional input record.

#
run_simulation_scenarios

fn run_simulation_scenarios(scenarios : Array[SimulationScenario]) -> Array[SimulationScenarioResult] raise SimulationError

Run multiple scenarios and return only failed results.

#
schedule_miss_rate

fn schedule_miss_rate(ticks : Array[SchedulerTick]) -> Double

Return the fraction of ticks that missed their deadline.

#
schedule_wire_bits

fn schedule_wire_bits(ticks : Array[SchedulerTick]) -> Int

Estimate the total wire bits for one scheduler window.

#
security_access

fn security_access(subfunction : Byte) -> DiagnosticRequest

Build a security-access seed/key request.

#
serialize_dbc_schema

fn serialize_dbc_schema(messages : Array[Message]) -> String raise DbcSchemaError

Serialize a schema to deterministic DBC text.

#
session_control

fn session_control(session : Byte) -> DiagnosticRequest

Build a session-control request.

#
set_bit

fn set_bit(bits : Array[Bool], position : Int, value : Bool) -> Array[Bool]

Set a bit in a defensive copy. Out-of-range positions are ignored.

#
set_counter_nibble

fn set_counter_nibble(data : Array[Byte], offset : Int, counter : Byte, high_nibble : Bool) -> Array[Byte] raise PayloadError

Insert a rolling counter into a payload nibble.

#
signal

fn signal(name : String, start_bit : Int, size : Int, little_endian? : Bool, signed? : Bool, factor? : Double, offset? : Double, minimum? : Double, maximum? : Double, unit? : String) -> Signal

Create a signal descriptor.

#
simulation_scenario_assertion_variants

fn simulation_scenario_assertion_variants() -> Array[SimulationScenarioAssertion]

#
simulation_scenario_event

fn simulation_scenario_event(timestamp_us : UInt64, frame : Frame, source? : String) -> SimulationScenarioEvent

#
simulation_scenario_state_text

fn simulation_scenario_state_text(state : SimulationScenarioState) -> String

#
simulation_scenario_state_variants

fn simulation_scenario_state_variants() -> Array[SimulationScenarioState]

#
simulation_scenario_summary

fn simulation_scenario_summary(results : Array[SimulationScenarioResult]) -> String

Produce a regression summary for scenario results.

#
sort_by_arbitration

fn sort_by_arbitration(frames : Array[Frame]) -> Array[Frame]

Return a stable arbitration-sorted copy.

#
sort_j1939

fn sort_j1939(messages : Array[J1939Message]) -> Array[J1939Message]

Return the standard J1939 priority ordering for messages.

#
stuff

fn stuff(bits : Array[Bool]) -> Array[Bool]

Apply CAN bit stuffing to a bit sequence.

#
tester_present

fn tester_present(suppress_response? : Bool) -> DiagnosticRequest

Build a tester-present request.

#
trace_diff

fn trace_diff(left : Trace, right : Trace, compare_timestamp? : Bool) -> Array[TraceDiff]

Compare two captures in order, reporting only observable differences.

#
trace_diff_kind_variants

fn trace_diff_kind_variants() -> Array[TraceDiffKind]

#
trace_export_between

fn trace_export_between(records : Array[TraceExportRecord], start_us : UInt64, end_us : UInt64) -> Array[TraceExportRecord]

Return records in a closed time interval.

#
trace_export_can_text

fn trace_export_can_text(records : Array[TraceExportRecord], options : TraceExportOptions) -> String

#
trace_export_csv

fn trace_export_csv(records : Array[TraceExportRecord], options : TraceExportOptions) -> String

#
trace_export_difference_count

fn trace_export_difference_count(left : Array[TraceExportRecord], right : Array[TraceExportRecord]) -> Int

Compare two export streams and return a compact diff count.

#
trace_export_filter_id

fn trace_export_filter_id(records : Array[TraceExportRecord], identifier : UInt) -> Array[TraceExportRecord]

Return records belonging to one identifier.

#
trace_export_format_variants

fn trace_export_format_variants() -> Array[TraceExportFormat]

#
trace_export_intervals

fn trace_export_intervals(records : Array[TraceExportRecord], identifier : UInt) -> Array[UInt64]

Calculate inter-arrival times for one identifier.

#
trace_export_options

fn trace_export_options(format? : TraceExportFormat, include_channel? : Bool, include_sequence? : Bool, include_header? : Bool, normalize_timestamps? : Bool, max_rows? : Int) -> TraceExportOptions

#
trace_export_record

fn trace_export_record(timestamp_us : UInt64, sequence : Int, channel : String, frame : Frame) -> TraceExportRecord

#
trace_export_records

fn trace_export_records(trace : Trace, channel? : String, normalize_timestamps? : Bool) -> Array[TraceExportRecord]

Convert a trace into ordered export records.

#
trace_export_replay_script

fn trace_export_replay_script(records : Array[TraceExportRecord]) -> String

#
trace_export_sample

fn trace_export_sample(records : Array[TraceExportRecord], stride : Int) -> Array[TraceExportRecord]

Produce a bounded sample for a large trace export.

#
trace_export_summary

fn trace_export_summary(records : Array[TraceExportRecord]) -> String

#
trace_export_time_range

fn trace_export_time_range(records : Array[TraceExportRecord]) -> (UInt64, UInt64)?

Return the earliest and latest timestamps in an export.

#
trace_from_text

fn trace_from_text(text : String) -> Trace raise TraceError

Parse a trace produced by Trace::to_text.

#
trace_import_can_text

fn trace_import_can_text(text : String) -> Trace raise CanTextError

Parse a compact CAN-text export generated by this package.

#
trace_metrics

fn trace_metrics(trace : Trace) -> FrameMetrics

Compute metrics directly from a trace.

#
trace_query

fn trace_query(trace : Trace, query : TraceQuerySpec) -> Array[TraceQueryMatch]

Select entries from a trace without changing capture order.

#
trace_query_buckets

fn trace_query_buckets(trace : Trace, start_us : UInt64, end_us : UInt64, bucket_us : UInt64) -> Array[TraceQueryBucket]

Partition a trace into fixed-width buckets.

#
trace_query_first

fn trace_query_first(trace : Trace, query : TraceQuerySpec) -> TraceQueryMatch?

Return the first query match, if any.

#
trace_query_identifier_counts

fn trace_query_identifier_counts(matches : Array[TraceQueryMatch]) -> Array[(UInt, Int)]

Count frames by identifier in a query result.

#
trace_query_last

fn trace_query_last(trace : Trace, query : TraceQuerySpec) -> TraceQueryMatch?

Return the last query match, if any.

#
trace_query_matches

fn trace_query_matches(frame : Frame, predicates : Array[TraceQueryPredicate]) -> Bool

#
trace_query_matches_predicate

fn trace_query_matches_predicate(frame : Frame, predicate : TraceQueryPredicate) -> Bool

Return whether a frame matches one predicate.

#
trace_query_predicate_variants

fn trace_query_predicate_variants() -> Array[TraceQueryPredicate]

#
trace_query_summary

fn trace_query_summary(matches : Array[TraceQueryMatch]) -> String

Return a stable textual summary of a trace query.

#
trace_replay_plan

fn trace_replay_plan(trace : Trace, scale_num? : UInt64, scale_den? : UInt64) -> TraceReplayPlan

#
transfer_data

fn transfer_data(block_counter : Byte, data : Array[Byte]) -> DiagnosticRequest raise UdsError

Build a transfer-data block.

#
uds_negative_code_name

fn uds_negative_code_name(code : Byte) -> String

Return a stable description for common UDS negative response codes.

#
uds_service_id

fn uds_service_id(service : UdsService) -> Byte

Return the numeric service identifier.

#
uds_service_name

fn uds_service_name(service : UdsService) -> String

Return the service's stable diagnostic name.

#
uds_session_name

fn uds_session_name(state : UdsSessionState) -> String

Return a stable state label.

#
validate_dbc_schema

fn validate_dbc_schema(messages : Array[Message]) -> DbcSchemaReport raise DbcSchemaError

Validate identifiers, payload bounds and signal overlap.

#
validate_frame

fn validate_frame(frame : Frame) -> FrameReport

Validate protocol and simulation invariants.

#
validate_j1939

fn validate_j1939(value : J1939Id) -> Unit raise J1939Error

Validate a J1939 identifier's fields.

#
wire_round_trip

fn wire_round_trip(frame : Frame) -> Bool

Verify that a frame's wire encoding can be decoded without loss.

#
write_data

fn write_data(identifier : UInt, data : Array[Byte]) -> DiagnosticRequest raise UdsError

Build a write-data-by-identifier request.

#
write_memory

fn write_memory(address : UInt, data : Array[Byte], address_bytes? : Int) -> DiagnosticRequest raise UdsError

Build a memory write request.