Skip to main content

ace_uds/message/services/
read_data_by_identifier.rs

1use crate::UdsError;
2use ace_core::FrameIter;
3use ace_macros::FrameCodec;
4
5#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, FrameCodec)]
6#[frame(error = UdsError)]
7pub struct ReadDataByIdentifierRequest<'a> {
8    pub data_identifiers: FrameIter<'a, DataIdentifier>,
9}
10
11#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, FrameCodec)]
12#[frame(error = UdsError)]
13pub struct ReadDataByIdentifierResponse<'a> {
14    pub data_identifier_responses: FrameIter<'a, DataIdentifierResponse<'a>>,
15}
16
17#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, FrameCodec)]
18#[frame(error = UdsError)]
19pub struct DataIdentifierResponse<'a> {
20    pub data_identifier: DataIdentifier,
21    pub data_record: &'a [u8],
22}
23
24#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, FrameCodec)]
25#[frame(error = UdsError)]
26#[repr(u16)]
27pub enum DataIdentifier {
28    #[frame(id_pat = "0x0000..=0x00FF | 0xFF02..=0xFFFF")]
29    IsoSaeReserved(u16),
30    #[frame(
31        id_pat = "0x0100..=0xA5FF | 0xA800..=0xACFF | 0xB000..=0xB1FF | 0xC000..=0xC2FF | 0xCF00..=0xEFFF | 0xF010..=0xF0FF"
32    )]
33    VehicleManufacturerSpecific(u16),
34    #[frame(
35        id_pat = "0xA600..=0xA7FF | 0xAD00..=0xAFFF | 0xB200..=0xBFFF | 0xC300..=0xCEFF | 0xFB00..=0xFCFF"
36    )]
37    ReservedForLegislativeUse(u16),
38    #[frame(id_pat = "0xF000..=0xF00F")]
39    NetworkConfigDataForTractorTrailerApp(u16),
40    #[frame(id_pat = "0xF100..=0xF17F | 0xF1A0..=0xF1EF")]
41    IdOptionVehicleManufacturerSpecific(u16),
42    #[frame(id = 0xF180)]
43    BootSoftware,
44    #[frame(id = 0xF181)]
45    ApplicationSoftware,
46    #[frame(id = 0xF182)]
47    ApplicationData,
48    #[frame(id = 0xF183)]
49    BootSoftwareFingerprint,
50    #[frame(id = 0xF184)]
51    ApplicationSoftwareFingerprint,
52    #[frame(id = 0xF185)]
53    ApplicationDataFingerprint,
54    #[frame(id = 0xF186)]
55    ActiveDiagnosticSession,
56    #[frame(id = 0xF187)]
57    VehicleManufacturerSparePartNumber,
58    #[frame(id = 0xF188)]
59    VehicleManufacturerEcuSoftwareNumber,
60    #[frame(id = 0xF189)]
61    VehicleManufacturerEcuSoftwareVersionNumber,
62    #[frame(id = 0xF18A)]
63    SystemSupplierIdentifier,
64    #[frame(id = 0xF18B)]
65    EcuManufactureringDate,
66    #[frame(id = 0xF18C)]
67    EcuSerialNumber,
68    #[frame(id = 0xF18D)]
69    SupportedFunctionalUnits,
70    #[frame(id = 0xF18E)]
71    VehicleManufacturerKitAssemblyPartNumber,
72    #[frame(id = 0xF18F)]
73    RegulationXSoftwareIdentificationNumbers,
74    #[frame(id = 0xF190)]
75    Vin,
76    #[frame(id = 0xF191)]
77    VehicleManufacturerEcuHardwareNumber,
78    #[frame(id = 0xF192)]
79    SystemSupplierEcuHardwareNumber,
80    #[frame(id = 0xF193)]
81    SystemSupplierEcuHardwareVersionNumber,
82    #[frame(id = 0xF194)]
83    SystemSupplierEcuSoftwareNumber,
84    #[frame(id = 0xF195)]
85    SystemSupplierEcuSoftwareVersionNumber,
86    #[frame(id = 0xF196)]
87    ExhaustRegulationOrTypeApprovalNumber,
88    #[frame(id = 0xF197)]
89    SystemNameOrEngineType,
90    #[frame(id = 0xF198)]
91    RepairShopCodeOrTesterSerialNumber,
92    #[frame(id = 0xF199)]
93    ProgrammingDate,
94    #[frame(id = 0xF19A)]
95    CalibrationRepairShopCodeOrCalibrationEquipmentSerialNumber,
96    #[frame(id = 0xF19B)]
97    CalibrationDate,
98    #[frame(id = 0xF19C)]
99    CalibrationEquipmentSoftwareNumber,
100    #[frame(id = 0xF19D)]
101    EcuInstallationDate,
102    #[frame(id = 0xF19E)]
103    OdxFile,
104    #[frame(id = 0xF19F)]
105    Entity,
106    #[frame(id_pat = "0xF1F0..=0xF1FF")]
107    IdOptionSystemSupplierSpecific(u16),
108    #[frame(id_pat = "0xF200..=0xF2FF")]
109    Periodic(u16),
110    #[frame(id_pat = "0xF300..=0xF3FF")]
111    DynamicallyDefined(u16),
112    #[frame(id_pat = "0xF400..=0xF5FF")]
113    ObdDataIdentifier(u16),
114    #[frame(id_pat = "0xF600..=0xF6FF")]
115    ObdMonitor(u16),
116    #[frame(id_pat = "0xF700..=0xF7FF")]
117    Obd(u16),
118    #[frame(id_pat = "0xF800..=0xF8FF")]
119    ObdInfoType(u16),
120    #[frame(id_pat = "0xF900..=0xF9FF")]
121    Tachograph(u16),
122    #[frame(id_pat = "0xFA00..=0xFA0F")]
123    AirbagDeployment(u16),
124    #[frame(id = 0xFA10)]
125    NumberOfEdrDevices,
126    #[frame(id = 0xFA11)]
127    EdrIdentification,
128    #[frame(id = 0xFA12)]
129    EdrDeviceAddressInformation,
130    #[frame(id_pat = "0xFA13..=0xFA18")]
131    EdrEntries(u16),
132    #[frame(id_pat = "0xFA19..=0xFAFF")]
133    SafetySystem(u16),
134    #[frame(id_pat = "0xFD00..=0xFEFF")]
135    SystemSupplierSpecific(u16),
136    #[frame(id = 0xFF00)]
137    UdsVersion,
138    #[frame(id = 0xFF01)]
139    TransportLayerSegmentationSupport,
140}