flync_4_diagnostics¶
Diagnostics Configuration¶
Note
Any diagnostics-related configuration is placed in the directory
📁 communication/diagnostics/, with one sub-directory per diagnostic protocol.
This is a non-mandatory directory for the FLYNC configuration.
Everything FLYNC models today is UDS (ISO 14229) carried over DoIP (ISO 13400), so there are two sub-configurations:
📁
diagnostics/doip/- the DoIP transport: its timing profiles. The DoIP logical address of a diagnostic entity lives on thedoip_serversocket deployment.📁
diagnostics/uds/- the UDS servers plus the system-wide DID, routine, and DTC catalogs they draw from.
- class DiagnosticsConfig¶
Bases:
FLYNCBaseModelRoot object of a system’s diagnostics configuration, one folder per diagnostic protocol.
Everything FLYNC models today is UDS (ISO 14229) carried over DoIP (ISO 13400), so the two sub-configs are
doipfor the transport andudsfor the diagnostic services; a further protocol would be added as a sibling folder.Parameters¶
- versionLiteral[“0.14”], optional
The version of this config. Defaults to
"0.14".- doip
DoIPConfig, optional DoIP transport configuration, loaded from
diagnostics/doip/. Absent when that directory does not exist.- uds
UDSConfig, optional UDS configuration - servers plus the DID/routine/DTC catalogs - loaded from
diagnostics/uds/. Absent when that directory does not exist.
DoIP¶
- class DoIPConfig¶
Bases:
FLYNCBaseModelThe system-wide DoIP (ISO 13400) transport configuration.
Parameters¶
- versionLiteral[“0.14”], optional
The version of this config. Defaults to
"0.14".- timings
DoIPTimingProfileSet DoIP timing profiles, loaded from
doip/timings.flync.yaml. Required: adoip/folder without that file describes no transport at all.
DoIP Timings¶
- class DoIPTimingProfileSet¶
Bases:
FLYNCBaseModelContainer of DoIP timing profiles, loaded from
doip/timings.flync.yaml.Parameters¶
- profileslist of
DoIPTimingProfile, optional Timing profiles available for use by DoIP deployments.
- defaultslist of
DoIPTimingProfile, optional Timing profiles used as system-wide defaults.
- profileslist of
- class DoIPTimingProfile¶
Bases:
DoIPTimingsA named, reusable set of DoIP timers, referenced by a DoIP socket deployment.
Parameters¶
- profile_idstr
Unique identifier of this timing profile.
- a_doip_ctrlint, optional
Maximum time in ms to wait for a diagnostic response over DoIP (
A_DoIP_Ctrl). Defaults to2000.- t_tcp_general_inactivityint, optional
General inactivity timeout in ms for an open DoIP TCP connection. Defaults to
300000.- t_tcp_initial_inactivityint, optional
Timeout in ms for the first diagnostic message after a TCP connection is opened. Defaults to
2000.- t_tcp_alive_checkint, optional
Timeout in ms to wait for a response to an alive check request. Defaults to
500.- a_doip_announce_numint, optional
Number of vehicle announcement messages sent after DoIP entity power-up. Defaults to
3.- a_doip_announce_intervalint, optional
Interval in ms between successive vehicle announcement messages. Defaults to
500.- a_doip_announce_waitint, optional
Initial delay in ms before the first vehicle announcement message is sent. Defaults to
500.
- class DoIPTimings¶
Bases:
FLYNCBaseModelDoIP protocol timers, as defined by ISO 13400.
Parameters¶
- a_doip_ctrlint, optional
Maximum time in ms to wait for a diagnostic response over DoIP (
A_DoIP_Ctrl). Defaults to2000.- t_tcp_general_inactivityint, optional
General inactivity timeout in ms for an open DoIP TCP connection. Defaults to
300000.- t_tcp_initial_inactivityint, optional
Timeout in ms for the first diagnostic message after a TCP connection is opened. Defaults to
2000.- t_tcp_alive_checkint, optional
Timeout in ms to wait for a response to an alive check request. Defaults to
500.- a_doip_announce_numint, optional
Number of vehicle announcement messages sent after DoIP entity power-up. Defaults to
3.- a_doip_announce_intervalint, optional
Interval in ms between successive vehicle announcement messages. Defaults to
500.- a_doip_announce_waitint, optional
Initial delay in ms before the first vehicle announcement message is sent. Defaults to
500.
DoIP Deployment¶
Hint
DoIP deployments are directly configured in a socket. For further details on the configuration go to: Socket Config.
- class DoIPServerDeployment¶
Bases:
FLYNCBaseModelDeploys a DoIP entity (server) that answers UDS diagnostic requests on this socket.
Belongs on a
SocketTCPonly - DoIP diagnostic messaging (ISO 13400) runs over TCP.Parameters¶
deployment_type : Literal[“doip_server”]
- namestr
Name of the deployment, typically the ECU or diagnostic entity it represents.
- logical_addressint
The 16-bit DoIP logical address of this diagnostic entity. Must be unique across the whole system.
- uds_serverstr
Name of the
UDSServer(access profiles, supported services, DIDs, DTCs) exposed by this entity.- doip_timings_profilestr, optional
Name of the
DoIPTimingProfileused by this entity.Noneuses the system default profile.
- class DoIPDiscoveryDeployment¶
Bases:
FLYNCBaseModelDeploys the DoIP discovery endpoint: vehicle identification requests and, optionally, vehicle announcement messages, as specified by ISO 13400.
Belongs on a
SocketUDPonly - DoIP discovery runs over UDP.Parameters¶
deployment_type : Literal[“doip_discovery”]
- namestr, optional
Name of the deployment, used to identify it in validation messages.
- vehicle_identificationbool, optional
Whether this endpoint answers VehicleIdentificationRequest messages. Defaults to
True.- vehicle_announcementbool, optional
Whether this endpoint sends VehicleAnnouncementMessages on power-up. Defaults to
True.- doip_timings_profilestr, optional
Name of the
DoIPTimingProfileused for the announcement timers.Noneuses the system default profile.
UDS¶
- class UDSConfig¶
Bases:
FLYNCBaseModelThe system-wide UDS (ISO 14229) configuration: the UDS servers and the catalogs they draw their DIDs, routines, and DTCs from.
Parameters¶
- versionLiteral[“0.14”], optional
The version of this config. Defaults to
"0.14".- timings
UDSTimingProfileSet UDS timing profiles, loaded from
uds/timings.flync.yaml. Required: every UDS server references one of these profiles.- serverslist of
UDSServer, optional UDS servers, one per file under
uds/servers/.- didslist of
DataIdentifier, optional DID catalog, one per file under
uds/dids/.- routineslist of
Routine, optional Routine catalog, one per file under
uds/routines/.- dtcslist of
DiagnosticTroubleCode, optional DTC catalog, one per file under
uds/dtcs/.
UDS Timings¶
- class UDSTimingProfileSet¶
Bases:
FLYNCBaseModelContainer of UDS timing profiles, loaded from
uds/timings.flync.yaml.Parameters¶
- profileslist of
UDSTimingProfile, optional Timing profiles available for use by UDS servers.
- defaultslist of
UDSTimingProfile, optional Timing profiles used as system-wide defaults.
- profileslist of
- class UDSTimingProfile¶
Bases:
UDSTimingsA named, reusable set of UDS server timings, referenced by a
UDSServer.Parameters¶
- profile_idstr
Unique identifier of this timing profile.
- p2_serverint, optional
Default UDS server response time in ms (
P2_server). Defaults to50.- p2_star_serverint, optional
Enhanced UDS server response time in ms after a pending response (
P2*_server). Defaults to5000.- s3_serverint, optional
Time in ms the server keeps a non-default diagnostic session active without tester presence (
S3_server). Defaults to5000.
- class UDSTimings¶
Bases:
FLYNCBaseModelUDS server timing parameters, as defined by ISO 14229-2.
Parameters¶
- p2_serverint, optional
Default UDS server response time in ms (
P2_server). Defaults to50.- p2_star_serverint, optional
Enhanced UDS server response time in ms after a pending response (
P2*_server). Defaults to5000.- s3_serverint, optional
Time in ms the server keeps a non-default diagnostic session active without tester presence (
S3_server). Defaults to5000.
UDS Server¶
- class UDSServer¶
Bases:
FLYNCBaseModelA named UDS server (ISO 14229 server side, typically one ECU).
Stored one per file under
communication/diagnostics/uds/servers/; the file name providesname. Referenced by name from adoip_serversocket deployment, which adds the DoIP logical address and DoIP timings of the transport.Parameters¶
- namestr
Name of the UDS server, implied from the file name on disk.
- uds_timings_profilestr
Name of the
UDSTimingProfileused by this server.- access_profileslist of
AccessProfile, optional Named session/security-level bundles referenced by services, DIDs, and routines.
- serviceslist of
DiagnosticSessionControlServiceorEcuResetServiceorClearDiagnosticInformationServiceorReadDTCInformationServiceorReadDataByIdentifierServiceorSecurityAccessServiceorRoutineControlServiceorRequestDownloadServiceorRequestUploadServiceorGenericUDSService, optional The UDS services supported by this server, selected by their
sid.- didslist of str, optional
Names of the
DataIdentifierentries (fromcommunication/diagnostics/uds/dids/) offered by this server.- dtcslist of str, optional
Names of the
DiagnosticTroubleCodeentries (fromcommunication/diagnostics/uds/dtcs/) reported by this server.- descriptionstr, optional
Human-readable description of the UDS server.
- class AccessProfile¶
Bases:
FLYNCBaseModelA named, reusable bundle of the sessions (and optional security level) required to access a service, DID, or routine.
Parameters¶
- namestr
Name of the access profile, unique within its UDS server.
- defaultbool, optional
Whether this is the server’s default access profile. Exactly one access profile of a UDS server must set this. Defaults to
False.- sessionslist of str
Names of the sessions (declared in the
diagnostic_session_controlservice) in which access is granted.- security_levelint or Literal[“Locked”], optional
Security level (declared in the
security_accessservice) that must be unlocked.Nonemeans no security access is required.
UDS Services¶
Every UDS service is a GenericUDSService; the
services that carry structure of their own inherit from it. Which class a services
entry becomes is decided by its sid, so a service id FLYNC does not model in detail -
an OEM-specific one, for instance - still loads as the generic service.
Note
A service id standardized by ISO 14229-1 must use its canonical service name even
when it has no dedicated model, so a typo is caught for every UDS service rather than
only the modeled ones. The names are listed in
CANONICAL_SERVICE_NAMES.
Services that carry no configuration of their own - WriteDataByIdentifier (0x2E),
TransferData (0x36), RequestTransferExit (0x37), TesterPresent (0x3E) - stay the generic
service on purpose: what they would hold already lives elsewhere, e.g. a DID’s
writability on DataIdentifier. The UDS server
still checks that they are coherent with the catalogs they act on.
Sub-function values are accepted either as the ISO 14229-1 snake_case name or as the raw number, so supplier- and manufacturer-specific sub-functions still load:
- ResetType¶
The EcuReset (0x11)
resetTypevalues standardized by ISO 14229-1. Values 0x40-0x5F are system-supplier specific and are written as plain integers instead.alias of
Literal[‘hard_reset’, ‘key_off_on_reset’, ‘soft_reset’, ‘enable_rapid_power_shutdown’, ‘disable_rapid_power_shutdown’]
- DTCReportType¶
The ReadDTCInformation (0x19)
reportTypevalues standardized by ISO 14229-1.alias of
Literal[‘report_number_of_dtc_by_status_mask’, ‘report_dtc_by_status_mask’, ‘report_dtc_snapshot_identification’, ‘report_dtc_snapshot_record_by_dtc_number’, ‘report_dtc_stored_data_by_record_number’, ‘report_dtc_ext_data_record_by_dtc_number’, ‘report_number_of_dtc_by_severity_mask_record’, ‘report_dtc_by_severity_mask_record’, ‘report_severity_information_of_dtc’, ‘report_supported_dtc’, ‘report_first_test_failed_dtc’, ‘report_first_confirmed_dtc’, ‘report_most_recent_test_failed_dtc’, ‘report_most_recent_confirmed_dtc’, ‘report_mirror_memory_dtc_by_status_mask’, ‘report_mirror_memory_dtc_ext_data_record_by_dtc_number’, ‘report_number_of_mirror_memory_dtc_by_status_mask’, ‘report_number_of_emissions_obd_dtc_by_status_mask’, ‘report_emissions_obd_dtc_by_status_mask’, ‘report_dtc_fault_detection_counter’, ‘report_dtc_with_permanent_status’, ‘report_dtc_ext_data_record_by_record_number’, ‘report_user_def_memory_dtc_by_status_mask’, ‘report_user_def_memory_dtc_snapshot_record_by_dtc_number’, ‘report_user_def_memory_dtc_ext_data_record_by_dtc_number’, ‘report_supported_dtc_ext_data_record’, ‘report_wwh_obd_dtc_by_mask_record’, ‘report_wwh_obd_dtc_with_permanent_status’, ‘report_dtc_information_by_dtc_readiness_group_identifier’]
- DTCStatusBit¶
The bits of the ISO 14229-1
DTCStatusAvailabilityMask, least significant bit first.alias of
Literal[‘test_failed’, ‘test_failed_this_operation_cycle’, ‘pending_dtc’, ‘confirmed_dtc’, ‘test_not_completed_since_last_clear’, ‘test_failed_since_last_clear’, ‘test_not_completed_this_operation_cycle’, ‘warning_indicator_requested’]
- IOControlParameter¶
The InputOutputControlByIdentifier (0x2F)
inputOutputControlParametervalues standardized by ISO 14229-1. Values 0x04-0xFF are vehicle-manufacturer specific.alias of
Literal[‘return_control_to_ecu’, ‘reset_to_default’, ‘freeze_current_state’, ‘short_term_adjustment’]
- class GenericUDSService¶
Bases:
FLYNCBaseModelBase class of every UDS service, and the service model used for any service without dedicated structure of its own (e.g. WriteDataByIdentifier, TesterPresent, ControlDTCSetting, TransferData).
Parameters¶
- servicestr
Name of the service, e.g.
"tester_present". Pinned to the ISO 14229-1 name wheneversidis a standardized service id.- sidint
The UDS service identifier, e.g.
0x3E.- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one (e.g. ControlDTCSetting).
- class DiagnosticSessionControlService¶
Bases:
GenericUDSServiceDiagnosticSessionControl (0x10): declares the sessions offered by the UDS server.
Parameters¶
service : Literal[“diagnostic_session_control”]
sid : Literal[0x10]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- sessionslist of
DiagnosticSessionDefinition, optional Diagnostic sessions offered by this service.
- class DiagnosticSessionDefinition¶
Bases:
FLYNCBaseModelA diagnostic session offered by the
diagnostic_session_controlservice.The session named
"default"is the session the ECU starts in after reset; exactly one session of aDiagnosticSessionControlServicemust use that name.Parameters¶
- namestr
Name of the session, e.g.
"extended".- idint
The 8-bit session sub-function value, e.g.
0x03for the extended session.- p2int, optional
Server response time in ms for this session (
P2_server).Nonefalls back to the owning server’s UDS timing profile.- p2_starint, optional
Enhanced server response time in ms for this session (
P2*_server).Nonefalls back to the owning server’s UDS timing profile.
- class EcuResetService¶
Bases:
GenericUDSServiceEcuReset (0x11): declares the reset types the UDS server accepts.
Parameters¶
service : Literal[“ecu_reset”]
sid : Literal[0x11]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- reset_typeslist of Literal[“hard_reset”, “key_off_on_reset”, “soft_reset”, “enable_rapid_power_shutdown”, “disable_rapid_power_shutdown”] or int, optional
Reset types this service accepts. An
intcarries a system-supplier specific reset type (0x40-0x5F) that ISO 14229-1 does not name.- power_down_timeint, optional
Minimum standby time in seconds the server reports for
enable_rapid_power_shutdown. 0xFF is reserved by ISO 14229-1 for “failure or time not available”, so the configurable maximum is 0xFE.
- class SecurityAccessService¶
Bases:
GenericUDSServiceSecurityAccess (0x27): declares the security levels offered by the UDS server.
Parameters¶
service : Literal[“security_access”]
sid : Literal[0x27]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- security_levelslist of
SecurityLevelDeclaration, optional Security levels offered by this service.
- class SecurityLevelDeclaration¶
Bases:
FLYNCBaseModelDeclares one security level made available by the
security_accessservice.Parameters¶
- security_levelint or Literal[“Locked”]
Identifier of the security level.
"Locked"represents no security access granted.
- class RoutineControlService¶
Bases:
GenericUDSServiceRoutineControl (0x31): declares the routines offered by the UDS server.
Parameters¶
service : Literal[“routine_control”]
sid : Literal[0x31]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- routineslist of str, optional
Names of the
Routineentries (fromcommunication/diagnostics/uds/routines/) offered by this service.
- class ClearDiagnosticInformationService¶
Bases:
GenericUDSServiceClearDiagnosticInformation (0x14): declares the clearable DTC groups.
Parameters¶
service : Literal[“clear_diagnostic_information”]
sid : Literal[0x14]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- dtc_groupslist of
DTCGroup, optional DTC groups (masks) that ClearDiagnosticInformation may clear.
- memory_selectionslist of int, optional
User-defined memories this service can clear, as the optional
MemorySelectionbyte added by ISO 14229-1:2020. Empty means the primary memory only.
- class DTCGroup¶
Bases:
FLYNCBaseModelA named group (mask) of DTCs, used by ClearDiagnosticInformation.
Parameters¶
- namestr
Name of the group, e.g.
"powertrain".- idint
The 3-byte DTC group mask, e.g.
0xFFFFFFfor “all groups”.
- class ReadDTCInformationService¶
Bases:
GenericUDSServiceReadDTCInformation (0x19): declares the DTC report types and the status bits the UDS server supports.
Parameters¶
service : Literal[“read_dtc_information”]
sid : Literal[0x19]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- report_typeslist of
DTCReportTypeor int, optional Report types (sub-functions) this service supports. An
intcarries a report type ISO 14229-1 does not name.- dtc_status_availability_maskint, optional
The
DTCStatusAvailabilityMaskthe server reports: which DTC status bits it maintains, e.g.0x7F. Usestatus_mask_from_bits()andstatus_mask_bits()to convert between the byte and theDTCStatusBitnames an OEM specification lists.- memory_selectionslist of int, optional
User-defined memory numbers addressable by the
report_user_def_memory_*report types. Empty means the primary memory only.- snapshot_record_numberslist of int, optional
DTC snapshot (freeze frame) record numbers the server stores.
- ext_data_record_numberslist of int, optional
DTC extended data record numbers the server stores.
- class ReadDataByIdentifierService¶
Bases:
GenericUDSServiceReadDataByIdentifier (0x22): reads the DIDs its UDS server offers.
Which DIDs those are is not repeated here - it is the server’s
didslist, filtered by eachDataIdentifier’saccess. This service only adds what the server itself declares about the request.Parameters¶
service : Literal[“read_data_by_identifier”]
sid : Literal[0x22]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- max_dids_per_requestint, optional
Largest number of data identifiers the server accepts in one request.
Nonemeans the server declares no limit.
- class UDSSubfunction¶
Bases:
FLYNCBaseModelA named sub-function value of a UDS service.
Parameters¶
- idint
The sub-function identifier.
- namestr
Human-readable name of the sub-function.
Block Transfer¶
- class TransferSetupService¶
Bases:
GenericUDSServiceCommon base of the block transfer set-up services RequestDownload (0x34) and RequestUpload (0x35), which share their whole parameter set.
This class is not selectable on its own - it carries no
sidof its own and is not a member ofUDSServiceEntry.Parameters¶
- servicestr
Name of the service. Narrowed by the concrete subclasses.
- sidint
The UDS service identifier. Narrowed by the concrete subclasses.
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- max_block_lengthint
The
maxNumberOfBlockLengththe server reports: the largest TransferData request it accepts, including the service id and block sequence counter.- memory_address_lengthint, optional
Number of bytes of the
memoryAddressparameter - the low nibble of theaddressAndLengthFormatIdentifier. Defaults to4.- memory_size_lengthint, optional
Number of bytes of the
memorySizeparameter - the high nibble of theaddressAndLengthFormatIdentifier. Defaults to4.- data_format_identifierslist of int, optional
The
dataFormatIdentifiervalues the server accepts. Defaults to[0x00], i.e. neither compressed nor encrypted.- memory_regionslist of
TransferMemoryRegion, optional Memory regions this service may address.
- class RequestDownloadService¶
Bases:
TransferSetupServiceRequestDownload (0x34): sets up a transfer from the tester into the UDS server.
Parameters¶
service : Literal[“request_download”]
sid : Literal[0x34]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- max_block_lengthint
The
maxNumberOfBlockLengththe server reports.- memory_address_lengthint, optional
Number of bytes of the
memoryAddressparameter. Defaults to4.- memory_size_lengthint, optional
Number of bytes of the
memorySizeparameter. Defaults to4.- data_format_identifierslist of int, optional
The
dataFormatIdentifiervalues the server accepts. Defaults to[0x00].- memory_regionslist of
TransferMemoryRegion, optional Memory regions this service may write to.
- class RequestUploadService¶
Bases:
TransferSetupServiceRequestUpload (0x35): sets up a transfer from the UDS server to the tester.
Parameters¶
service : Literal[“request_upload”]
sid : Literal[0x35]
- access_profilestr, optional
Name of the access profile required to use this service.
Nonemeans the owning UDS server’s default access profile applies.- subfunctionslist of
UDSSubfunction, optional Sub-function values supported by this service.
- option_recorddict, optional
Free-form option record for services that carry one.
- max_block_lengthint
The
maxNumberOfBlockLengththe server reports.- memory_address_lengthint, optional
Number of bytes of the
memoryAddressparameter. Defaults to4.- memory_size_lengthint, optional
Number of bytes of the
memorySizeparameter. Defaults to4.- data_format_identifierslist of int, optional
The
dataFormatIdentifiervalues the server accepts. Defaults to[0x00].- memory_regionslist of
TransferMemoryRegion, optional Memory regions this service may read from.
- class TransferMemoryRegion¶
Bases:
FLYNCBaseModelA memory region a block transfer service may address.
Parameters¶
- namestr
Name of the region, e.g.
"application".- addressint
Start address of the region.
- sizeint
Size of the region in bytes.
- descriptionstr, optional
Human-readable description of the region.
DIDs, Routines, and DTCs¶
- class DataIdentifier¶
Bases:
FLYNCBaseModelA UDS Data Identifier, readable with ReadDataByIdentifier (0x22) and/or writable with WriteDataByIdentifier (0x2E).
Stored one per file under
communication/diagnostics/uds/dids/; the file name providesname.Parameters¶
- namestr
Name of the DID, implied from the file name on disk.
- didint
The 16-bit data identifier, e.g.
0xF190.- accessLiteral[“read”, “write”, “read_write”], optional
How the DID may be accessed. Defaults to
"read".- read_data
DiagDataRecord, optional Layout of the positive response to ReadDataByIdentifier. Required when the DID is readable.
- write_data
DiagDataRecord, optional Layout of the WriteDataByIdentifier request data. Required when the DID is writable. When omitted for a
"read_write"DID the layout ofread_dataapplies.- io_control
DIDIOControl, optional Declares that InputOutputControlByIdentifier (0x2F) may control this DID.
Nonemeans the DID is not IO-controllable.- access_profilestr, optional
Name of the access profile (declared by the UDS server offering this DID) required to access the DID.
Nonemeans that server’s default access profile applies.- descriptionstr, optional
Human-readable description of the DID.
- class DIDIOControl¶
Bases:
FLYNCBaseModelDeclares that a DID can be controlled with InputOutputControlByIdentifier (0x2F), and with which control parameters.
Parameters¶
- supported_parameterslist of Literal[“return_control_to_ecu”, “reset_to_default”, “freeze_current_state”, “short_term_adjustment”] or int, optional
The
inputOutputControlParametervalues accepted for this DID. Anintcarries a vehicle-manufacturer specific parameter (0x04-0xFF). Defaults to["short_term_adjustment"].- control_state
DiagDataRecord, optional Layout of the
controlStaterecord sent withshort_term_adjustment. Required when that parameter is supported.- descriptionstr, optional
Human-readable description of the control behavior.
- class Routine¶
Bases:
FLYNCBaseModelA UDS Routine, invoked via RoutineControl (0x31).
Stored one per file under
communication/diagnostics/uds/routines/; the file name providesname.Parameters¶
- namestr
Name of the routine, implied from the file name on disk.
- ridint
The 16-bit routine identifier, e.g.
0x0203.- supported_sub_functionslist of Literal[“start”, “stop”, “request_results”], optional
Which RoutineControl sub-functions the routine implements. Defaults to
["start"].- start_request
DiagDataRecord, optional Request data layout for RoutineControl startRoutine. Required when
"start"is supported.- start_response
DiagDataRecord, optional Positive response data layout for startRoutine.
- stop_request
DiagDataRecord, optional Request data layout for stopRoutine. Required when
"stop"is supported.- stop_response
DiagDataRecord, optional Positive response data layout for stopRoutine.
- request_results_response
DiagDataRecord, optional Positive response data layout for requestRoutineResults. Required when
"request_results"is supported.- access_profilestr, optional
Name of the access profile (declared by the UDS server offering this routine) required to invoke it.
Nonemeans that server’s default access profile applies.- descriptionstr, optional
Human-readable description of the routine.
- class DiagnosticTroubleCode¶
Bases:
FLYNCBaseModelA UDS Diagnostic Trouble Code (DTC), reported via ReadDTCInformation (0x19) and cleared via ClearDiagnosticInformation (0x14).
Stored one per file under
communication/diagnostics/uds/dtcs/; the file name providesname.Parameters¶
- namestr
Name of the DTC, implied from the file name on disk.
- dtcint
The 3-byte DTC number, e.g.
0x010203.- formatLiteral[“iso_14229_1”, “saej1939_73”, “iso_11992_4”], optional
Format of
dtcas reported by ReadDTCInformation. Defaults to"iso_14229_1".- severityLiteral[“no_severity”, “maintenance_only”, “check_at_next_halt”, “check_immediately”], optional
UDS DTC severity mask. Defaults to
"no_severity".- functional_unitint, optional
The
DTCFunctionalUnitreported together withseverityby ReadDTCInformation sub-function 0x09.Nonemeans the server reports no functional unit for this DTC.- snapshot_recordslist of
DTCRecord, optional Snapshot (freeze frame) records the server stores for this DTC, reported by ReadDTCInformation sub-function 0x04.
- extended_data_recordslist of
DTCRecord, optional Extended data records the server stores for this DTC, reported by ReadDTCInformation sub-functions 0x06 and 0x16.
- failure_typestr, optional
Free-text classification of the underlying failure, e.g.
"short_to_ground".- descriptionstr, optional
Human-readable description of the DTC.
- class DTCRecord¶
Bases:
FLYNCBaseModelA numbered data record ReadDTCInformation reports for a DTC.
Snapshot (freeze frame) records and extended data records have the same shape, so both are described by this class; which kind a record is follows from the list it appears in -
DiagnosticTroubleCode.snapshot_recordsorDiagnosticTroubleCode.extended_data_records.Parameters¶
- record_numberint
Number identifying this record, i.e. the
DTCSnapshotRecordNumberfor a snapshot record and theDTCExtDataRecordNumberfor an extended data record.- data
DiagDataRecord Layout of the data the record carries.
- descriptionstr, optional
Human-readable description of the record.
DID/Routine Payload Datatypes¶
Note
DID and routine payloads are described with a diagnostics-local field/record model, independent of the SOME/IP and signal type systems.
- class DiagDataRecord¶
Bases:
FLYNCBaseModelAn ordered, non-overlapping set of fields making up one UDS payload.
Parameters¶
- byte_lengthint
Total length of the record in bytes.
- fieldslist of
DiagField, optional Fields contained in the record. May be empty for a record whose contents are not modeled in detail.
- descriptionstr, optional
Human-readable description of the record.
- class DiagField¶
Bases:
FLYNCBaseModelA single field inside a diagnostic data record.
Parameters¶
- namestr
Name of the field, unique within its record.
- typeDiagPrimitiveType
Primitive type of the field.
- bit_offsetint
Offset of the field’s first bit from the start of the record. Bit 0 is the most significant bit of the first byte.
- bit_lengthint, optional
Width of the field in bits. Required for the variable-width types
asciiandbytes; for every other type it defaults to the type’s fixed width and, when given explicitly, must match it.- endiannessLiteral[“BE”, “LE”], optional
Byte order of the field. Defaults to big-endian (
"BE"), which is what UDS uses.- scaling
DiagScaling, optional Raw-to-physical conversion for this field.
- value_range
ValueRange, optional Inclusive range of valid raw values.
- value_tablelist of
ValueTable, optional Enumeration of named raw values.
- descriptionstr, optional
Human-readable description of the field.
- class DiagScaling¶
Bases:
FLYNCBaseModelLinear conversion from the raw transmitted value to the physical value.
physical = raw * factor + offsetParameters¶
- factorfloat, optional
Multiplier applied to the raw value. Defaults to
1.0.- offsetfloat, optional
Constant added after scaling. Defaults to
0.0.- unitstr, optional
Physical unit of the scaled value, e.g.
"km/h".