@page "/diagnostics"
@inject DiagnosticPageViewModel Diagnostics
Synthetic diagnostics - AutoForge
Synthetic module diagnostics
This workflow sends synthetic protocol v1 requests through the selected in-process
virtual transport. It is not a real vehicle connection, vehicle compatibility
determination, live capture or physical operation.
@if (Diagnostics.Providers.Count == 0)
{
No diagnostic provider is available. Replay and physical providers are not substituted.
}
Explicit profile and provider selection
Load synthetic truck example
The example import does not select the profile or open a session.
Saved profile identifier
Choose an exact saved profile
@foreach (var identifier in Diagnostics.AvailableProfiles.Select(profile => profile.ProfileIdentifier).Distinct(StringComparer.OrdinalIgnoreCase))
{
@identifier
}
Saved profile revision
Choose an exact revision
@foreach (var profile in Diagnostics.AvailableProfiles.Where(profile =>
StringComparer.OrdinalIgnoreCase.Equals(profile.ProfileIdentifier, Diagnostics.SelectedProfileIdentifier)))
{
revision @profile.Revision
}
Diagnostic provider
Choose an explicit provider
@foreach (var provider in Diagnostics.Providers)
{
@provider.Target.ProviderIdentifier (@provider.Target.Kind)
}
Operational target kind
Choose an explicit kind
Simulation
@if (Diagnostics.ActiveSession is null)
{
Open simulation session
}
else
{
@Diagnostics.ActiveSession.Identity.Target.Kind target @Diagnostics.ActiveSession.Identity.Target.ProviderIdentifier;
session @Diagnostics.ActiveSession.Identity.SessionIdentifier;
profile @Diagnostics.ActiveSession.Identity.ProfileIdentifier revision
@Diagnostics.ActiveSession.Identity.ProfileRevision;
configuration @Diagnostics.ActiveSession.Identity.ConfigurationIdentifier.
Probe virtual modules
Reset to synthetic initial state
Close session
@if (Diagnostics.IsBusy)
{
Cancel pending operation
}
}
@if (Diagnostics.OperationMessages.Count > 0)
{
Operation outcomes
@foreach (var message in Diagnostics.OperationMessages)
{
@message
}
}
@if (Diagnostics.ActiveSession is { } session)
{
Expected endpoints, validated probes and identified modules
@if (Diagnostics.DiscoverySummary is { } discoverySummary)
{
@discoverySummary
}
@if (Diagnostics.DiscoveredModules.Count == 0)
{
Module discovery has not been run for this session.
}
else
{
@foreach (var module in Diagnostics.DiscoveredModules)
{
@module.Endpoint.ModuleIdentifier at 0x@(module.Endpoint.Address) — Probe: @module.ProbeOutcome; identity: @module.IdentityStatus
@if (module.Identity is { } identity)
{
Role and name
@identity.Role — @identity.Name
Hardware/software/firmware/calibration identity
@(identity.HardwareIdentifier ?? "unknown") / @(identity.SoftwareIdentifier ?? "unknown") / @(identity.FirmwareIdentifier ?? "unknown") / @(identity.CalibrationIdentifier ?? "unknown")
}
else
{
Identity is unavailable or unverified.
@if (module.IdentityOutcome is { } identityOutcome)
{
Identity exchange outcome: @identityOutcome.
}
@module.IdentityError
@if (module.ProbeSucceeded)
{
A positive probe confirms only the advertised synthetic services, not identity or authorization.
}
}
@if (module.ProbeError is { } probeError)
{
Probe detail: @probeError
}
@if (module.ProbeSucceeded)
{
Validated probe advertised virtual services: @string.Join(", ", module.ImplementedServices).
}
@if (module.ImplementedServices.Contains(DiagnosticServices.ReadTroubleCodes, StringComparer.Ordinal) ||
module.ImplementedServices.Contains(DiagnosticServices.ReadSignals, StringComparer.Ordinal))
{
Diagnostics.ReadModuleAsync(module.Endpoint.ModuleIdentifier)">
Read DTCs and static signals
}
@if (module.ImplementedServices.Contains(DiagnosticServices.ClearTroubleCodes, StringComparer.Ordinal))
{
Diagnostics.ClearTroubleCodesAsync(module.Endpoint.ModuleIdentifier)">
Clear this module's virtual DTCs
}
@if (module.Identity is null &&
(module.ImplementedServices.Contains(DiagnosticServices.ReadTroubleCodes, StringComparer.Ordinal) ||
module.ImplementedServices.Contains(DiagnosticServices.ReadSignals, StringComparer.Ordinal) ||
module.ImplementedServices.Contains(DiagnosticServices.ClearTroubleCodes, StringComparer.Ordinal)))
{
Identity-dependent read and clear actions are disabled until profile identity is validated.
}
@if (Diagnostics.TroubleCodes.TryGetValue(module.Endpoint.ModuleIdentifier, out var dtcs))
{
Synthetic DTCs returned by this module
@if (dtcs.Codes.Count == 0)
{
Valid diagnostic response: no DTCs are currently stored in this virtual module.
}
else
{
@foreach (var code in dtcs.Codes)
{
@(code.Code) — @(code.Description) (source @(code.SourceModuleIdentifier))
}
}
}
@if (Diagnostics.Signals.TryGetValue(module.Endpoint.ModuleIdentifier, out var signals))
{
Static synthetic signal snapshot
@foreach (var signal in signals.Signals)
{
@signal.SignalIdentifier: @signal.Value (@signal.Unit), @signal.Quality,
logical tick @signal.LogicalTimeTicks, origin @signal.Origin,
source @signal.ModuleIdentifier.
}
}
}
}
Bounded session communication trace
Retained @session.Trace.Entries.Count records; dropped @session.Trace.DroppedRecordCount.
@foreach (var entry in session.Trace.Entries)
{
@entry.Outcome — @entry.Service ;
@entry.ModuleIdentifier at 0x@(entry.Address);
correlation @entry.CorrelationIdentifier;
logical ticks @entry.StartLogicalTicks–@entry.EndLogicalTicks.
@if (entry.DecodedSummary is not null)
{
Decoded: @entry.DecodedSummary.
}
@if (entry.Error is not null)
{
Error: @entry.Error
}
Raw synthetic protocol v1 payloads
Request: @System.Text.Encoding.UTF8.GetString(entry.RequestPayload.Span)
@if (entry.ResponsePayload is { } response)
{
Response: @System.Text.Encoding.UTF8.GetString(response.Span)
}
else
{
No response payload was received.
}
}
}