ISO-TP, UDS and OBD-II diagnostic toolkit for MoonBit.
moon test --target js
moon run cmd/main --target js -- session examples/uds-sessions/download-ok.log
moon run cmd/main --target js -- conversation examples/client/udsoncan-download.log
moon run cmd/main --target js -- conversation examples/client/download-size-mismatch.logpub(all) suberror IsotpError {
EmptyFrame
EmptyPayload
InvalidFrameSize(Int)
InvalidLength(Int)
TooLarge(Int)
UnexpectedFirstFrame
UnexpectedConsecutiveFrame
UnexpectedSingleFrame
BadSequence(Int, Int)
Incomplete(Int, Int)
}pub(all) enum DiagEvent {
UdsEvent(Int, UdsMessage)
ObdEvent(Int, ObdMessage)
RawEvent(Int, Array[Int])
}pub(all) struct Dtc {
code : String
system : String
description : String
failure_type : Int
status : Int
status_bits : Array[String]
}pub(all) struct IsotpReassembler {
max_len : Int
expected : Int
payload : Array[Int]
next_seq : Int
active : Bool
flow_control : Int
}fn IsotpReassembler::push(self : IsotpReassembler, frame : Array[Int]) -> Array[Int]? raise IsotpErrorpub(all) struct ObdReading {
pid : Int
label : String
value : String
unit : String
raw : Array[Int]
}pub(all) struct UdsSessionIssue {
step : Int
code : String
severity : String
detail : String
}pub(all) struct UdsSessionReport {
verdict : String
requests : Int
responses : Int
session : String
security_level : Int
transferred_bytes : Int
issues : Array[UdsSessionIssue]
}fn is_present_uds_record(high : Int, middle : Int, failure_type : Int, status : Int) -> Bool