open_protocol/messages/
tightening_result.rs

1use chrono::{DateTime, Local};
2use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
3use crate::types::datafield::DataField;
4use crate::types::trace::TraceSample;
5
6#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
7pub enum TraceType {
8    #[default]
9    #[open_protocol_value(number = 1)]
10    Angle,
11    #[open_protocol_value(number = 2)]
12    Torque,
13    #[open_protocol_value(number = 3)]
14    Current,
15    #[open_protocol_value(number = 4)]
16    Gradient,
17    #[open_protocol_value(number = 5)]
18    Stroke,
19    #[open_protocol_value(number = 6)]
20    Force
21}
22
23#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
24pub enum ObjectType {
25    #[default]
26    #[open_protocol_value(number = 1)]
27    DualReading,
28    #[open_protocol_value(number = 2)]
29    TighteningProduction,
30    #[open_protocol_value(number = 3)]
31    TighteningSimulation,
32    #[open_protocol_value(number = 4)]
33    JointCheck,
34    #[open_protocol_value(number = 5)]
35    Dimensional,
36}
37
38#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
39#[open_protocol_message(MID = 0060, revision = 1)]
40pub struct MID0060rev1 {
41    // Subscribe to tightening result data
42    // No fields for this revision
43}
44
45// MID0061 revisions
46#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
47#[open_protocol_message(MID = 0061, revision = 1)]
48pub struct MID0061rev1 {
49    /// The cell ID of the tightening system
50    #[open_protocol_field(number = 1, length = 4)]
51    pub cell_id: u16,
52
53    /// The channel ID for the tightening
54    #[open_protocol_field(number = 2, length = 2)]
55    pub channel_id: u8,
56
57    /// The name of the torque controller
58    #[open_protocol_field(number = 3, length = 25)]
59    pub controller_name: String,
60
61    /// The Vehicle Identification Number (VIN) used in the tightening
62    #[open_protocol_field(number = 4, length = 25)]
63    pub vin_number: String,
64
65    /// The ID of the job performed
66    #[open_protocol_field(number = 5, length = 2)]
67    pub job_id: u8,
68
69    /// The parameter set ID used
70    #[open_protocol_field(number = 6, length = 3)]
71    pub parameter_set_id: u16,
72
73    /// The total number of tightenings required in the batch
74    #[open_protocol_field(number = 7, length = 4)]
75    pub batch_size: u16,
76
77    /// The current batch counter
78    #[open_protocol_field(number = 8, length = 4)]
79    pub batch_counter: u16,
80
81    /// The status of the tightening (0=NOK, 1=OK)
82    #[open_protocol_field(number = 9, length = 1)]
83    pub tightening_status: u8,
84
85    /// The torque status (0=Low, 1=OK, 2=High)
86    #[open_protocol_field(number = 10, length = 1)]
87    pub torque_status: u8,
88
89    /// The angle status (0=Low, 1=OK, 2=High)
90    #[open_protocol_field(number = 11, length = 1)]
91    pub angle_status: u8,
92
93    /// The minimum torque limit
94    #[open_protocol_field(number = 12, length = 6)]
95    pub torque_min_limit: u32,
96
97    /// The maximum torque limit
98    #[open_protocol_field(number = 13, length = 6)]
99    pub torque_max_limit: u32,
100
101    /// The final torque target
102    #[open_protocol_field(number = 14, length = 6)]
103    pub torque_final_target: u32,
104
105    /// The achieved torque value
106    #[open_protocol_field(number = 15, length = 6)]
107    pub torque: u32,
108
109    /// The minimum angle limit
110    #[open_protocol_field(number = 16, length = 5)]
111    pub angle_min_limit: u16,
112
113    /// The maximum angle limit
114    #[open_protocol_field(number = 17, length = 5)]
115    pub angle_max_limit: u16,
116
117    /// The final angle target
118    #[open_protocol_field(number = 18, length = 5)]
119    pub angle_final_target: u16,
120
121    /// The achieved angle value
122    #[open_protocol_field(number = 19, length = 5)]
123    pub angle: u16,
124
125    /// Timestamp of the tightening
126    #[open_protocol_field(number = 20, length = 19)]
127    pub timestamp: DateTime<Local>,
128
129    /// Timestamp of the last parameter set change
130    #[open_protocol_field(number = 21, length = 19)]
131    pub last_parameter_set_change: DateTime<Local>,
132
133    /// The batch status (0=NOK, 1=OK, 2=Not used, 3=Running)
134    #[open_protocol_field(number = 22, length = 1)]
135    pub batch_status: u8,
136
137    /// The tightening ID, a unique identifier for each result
138    #[open_protocol_field(number = 23, length = 10)]
139    pub tightening_id: u32,
140}
141
142#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
143#[open_protocol_message(MID = 0061, revision = 2)]
144pub struct MID0061rev2 {
145    /// The cell ID of the tightening system
146    #[open_protocol_field(number = 1, length = 4)]
147    pub cell_id: u16,
148
149    /// The channel ID for the tightening
150    #[open_protocol_field(number = 2, length = 2)]
151    pub channel_id: u8,
152
153    /// The name of the torque controller
154    #[open_protocol_field(number = 3, length = 25)]
155    pub controller_name: String,
156
157    /// The Vehicle Identification Number (VIN) used in the tightening
158    #[open_protocol_field(number = 4, length = 25)]
159    pub vin_number: String,
160
161    /// The ID of the job performed
162    #[open_protocol_field(number = 5, length = 4)]
163    pub job_id: u16,
164
165    /// The parameter set ID used
166    #[open_protocol_field(number = 6, length = 3)]
167    pub parameter_set_id: u16,
168
169    /// Strategy used in the tightening
170    #[open_protocol_field(number = 7, length = 2)]
171    pub strategy: u8,
172
173    /// Strategy used in the tightening
174    #[open_protocol_field(number = 8, length = 5)]
175    pub strategy_options: u32,
176
177    /// Batch size for the tightening operation
178    #[open_protocol_field(number = 9, length = 4)]
179    pub batch_size: u16,
180
181    /// The current count of tightenings in the batch
182    #[open_protocol_field(number = 10, length = 4)]
183    pub batch_counter: u16,
184
185    /// The status of the tightening (0=NOK, 1=OK)
186    #[open_protocol_field(number = 11, length = 1)]
187    pub tightening_status: u8,
188
189    /// The batch status (0=NOK, 1=OK, 2=Not used, 3=Running)
190    #[open_protocol_field(number = 12, length = 1)]
191    pub batch_status: u8,
192
193    /// The torque status (0=Low, 1=OK, 2=High)
194    #[open_protocol_field(number = 13, length = 1)]
195    pub torque_status: u8,
196
197    /// The angle status (0=Low, 1=OK, 2=High)
198    #[open_protocol_field(number = 14, length = 1)]
199    pub angle_status: u8,
200
201    /// The rundown angle status (0=Low, 1=OK, 2=High)
202    #[open_protocol_field(number = 15, length = 1)]
203    pub rundown_angle_status: u8,
204
205    /// Current monitoring status (0=Low, 1=OK, 2=High)
206    #[open_protocol_field(number = 16, length = 1)]
207    pub current_monitoring_status: u8,
208
209    /// Self-tap status (0=Low, 1=OK, 2=High)
210    #[open_protocol_field(number = 17, length = 1)]
211    pub self_tap_status: u8,
212
213    /// Prevail torque monitoring status (0=Low, 1=OK, 2=High)
214    #[open_protocol_field(number = 18, length = 1)]
215    pub prevail_torque_monitoring_status: u8,
216
217    /// Prevail torque compensate status (0=Low, 1=OK, 2=High)
218    #[open_protocol_field(number = 19, length = 1)]
219    pub prevail_torque_compensate_status: u8,
220
221    /// Tightening error status
222    #[open_protocol_field(number = 20, length = 10)]
223    pub tightening_error_status: String,
224
225    /// Minimum torque limit
226    #[open_protocol_field(number = 21, length = 6)]
227    pub torque_min_limit: u32,
228
229    /// Maximum torque limit
230    #[open_protocol_field(number = 22, length = 6)]
231    pub torque_max_limit: u32,
232
233    /// Final torque target
234    #[open_protocol_field(number = 23, length = 6)]
235    pub torque_final_target: u32,
236
237    /// Achieved torque value
238    #[open_protocol_field(number = 24, length = 6)]
239    pub torque: u32,
240
241    /// Minimum angle limit
242    #[open_protocol_field(number = 25, length = 5)]
243    pub angle_min_limit: u16,
244
245    /// Maximum angle limit
246    #[open_protocol_field(number = 26, length = 5)]
247    pub angle_max_limit: u16,
248
249    /// Final angle target
250    #[open_protocol_field(number = 27, length = 5)]
251    pub angle_final_target: u16,
252
253    /// Achieved angle value
254    #[open_protocol_field(number = 28, length = 5)]
255    pub angle: u16,
256
257    /// Minimum rundown angle
258    #[open_protocol_field(number = 29, length = 5)]
259    pub rundown_angle_min: u16,
260
261    /// Maximum rundown angle
262    #[open_protocol_field(number = 30, length = 5)]
263    pub rundown_angle_max: u16,
264
265    /// Achieved rundown angle
266    #[open_protocol_field(number = 31, length = 5)]
267    pub rundown_angle: u16,
268
269    /// Minimum current monitoring value
270    #[open_protocol_field(number = 32, length = 3)]
271    pub current_monitoring_min: u16,
272
273    /// Maximum current monitoring value
274    #[open_protocol_field(number = 33, length = 3)]
275    pub current_monitoring_max: u16,
276
277    /// Achieved current monitoring value
278    #[open_protocol_field(number = 34, length = 3)]
279    pub current_monitoring_value: u16,
280
281    /// Minimum self-tap torque
282    #[open_protocol_field(number = 35, length = 6)]
283    pub self_tap_torque_min: u32,
284
285    /// Maximum self-tap torque
286    #[open_protocol_field(number = 36, length = 6)]
287    pub self_tap_torque_max: u32,
288
289    /// Achieved self-tap torque
290    #[open_protocol_field(number = 37, length = 6)]
291    pub self_tap_torque: u32,
292
293    /// Minimum prevail torque value
294    #[open_protocol_field(number = 38, length = 6)]
295    pub prevail_torque_min: u32,
296
297    /// Maximum prevail torque value
298    #[open_protocol_field(number = 39, length = 6)]
299    pub prevail_torque_max: u32,
300
301    /// Achieved prevail torque value
302    #[open_protocol_field(number = 40, length = 6)]
303    pub prevail_torque: u32,
304
305    /// The tightening ID, a unique identifier for this result
306    #[open_protocol_field(number = 41, length = 10)]
307    pub tightening_id: u32,
308
309    /// The job sequence number, a unique number for each job
310    #[open_protocol_field(number = 42, length = 5)]
311    pub job_sequence_number: u16,
312
313    /// The sync tightening ID
314    #[open_protocol_field(number = 43, length = 5)]
315    pub sync_tightening_id: u16,
316
317    /// The serial number of the tool
318    #[open_protocol_field(number = 44, length = 14)]
319    pub tool_serial_number: String,
320
321    /// Timestamp of the tightening
322    #[open_protocol_field(number = 45, length = 19)]
323    pub timestamp: DateTime<Local>,
324
325    /// Timestamp of the last parameter set change
326    #[open_protocol_field(number = 46, length = 19)]
327    pub last_parameter_set_change: DateTime<Local>,
328}
329
330#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
331#[open_protocol_message(MID = 0061, revision = 3)]
332pub struct MID0061rev3 {
333    /// Name of the parameter set used
334    #[open_protocol_field(number = 47, length = 25)]
335    pub parameter_set_name: String,
336
337    /// The unit of torque values (1=Nm, 2=Lbf.ft, 3=Lbf.In, etc.)
338    #[open_protocol_field(number = 48, length = 1)]
339    pub torque_unit: u8,
340
341    /// The result type (1=Tightening, 2=Loosening, etc.)
342    #[open_protocol_field(number = 49, length = 2)]
343    pub result_type: u8,
344}
345
346// MID0062 (Acknowledgment for MID0061 tightening results)
347#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
348#[open_protocol_message(MID = 0062, revision = 1)]
349pub struct MID0062rev1 {
350    // Acknowledgment for tightening result data
351    // No fields for this revision
352}
353
354// MID0063 (Unsubscribe from tightening results)
355#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
356#[open_protocol_message(MID = 0063, revision = 1)]
357pub struct MID0063rev1 {
358    // Unsubscribe from tightening result data
359    // No fields for this revision
360}
361
362// MID0064 (Old tightening result upload request)
363#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
364#[open_protocol_message(MID = 0064, revision = 1)]
365pub struct MID0064rev1 {
366    /// Request a specific tightening result by its ID
367    #[open_protocol_field(number = 1, length = 10)]
368    pub tightening_id: u32,
369}
370
371// MID0065 (Old tightening result upload reply)
372#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
373#[open_protocol_message(MID = 0065, revision = 1)]
374pub struct MID0065rev1 {
375    // Reply with the details of an old tightening result
376    // Contains the same fields as MID0061 revision 1, plus optional extensions
377}
378
379// MID0066 (Number of offline results)
380#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
381#[open_protocol_message(MID = 0066, revision = 1)]
382pub struct MID0066rev1 {
383    /// Number of offline results stored in the system
384    #[open_protocol_field(number = 1, length = 2)]
385    pub number_of_offline_results: u8,
386}
387
388#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
389#[open_protocol_message(MID = 0066, revision = 2)]
390pub struct MID0066rev2 {
391    /// Number of offline results stored in the system
392    #[open_protocol_field(number = 1, length = 3)]
393    pub number_of_offline_results: u16,
394
395    /// Number of offline curves stored in the system
396    #[open_protocol_field(number = 2, length = 3)]
397    pub number_of_offline_curves: u16,
398}
399
400// MID0067 (Tightening result list upload)
401#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
402#[open_protocol_message(MID = 0067, revision = 1)]
403pub struct MID0067rev1 {
404    /// Start index of the requested tightening results
405    #[open_protocol_field(number = 1, length = 10)]
406    pub start_index: u32,
407
408    /// Number of tightening results requested
409    #[open_protocol_field(number = 2, length = 3)]
410    pub count: u16,
411}
412
413/// 5.8.9 MID 0900 Trace curve data message
414#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
415#[open_protocol_message(MID = 0900, revision = 1)]
416pub struct MID0900rev1 {
417    /// The unique identifier for the result data.
418    #[open_protocol_field(length = 10)]
419    pub result_data_id: u32,
420
421    /// Timestamp of when the trace was recorded.
422    #[open_protocol_field(length = 19)]
423    pub timestamp: DateTime<Local>,
424
425    /// The number of PIDs (parameter data fields).
426    #[open_protocol_field(length = 3)]
427    pub number_of_pids: u16,
428
429    /// Data fields (list of parameter values).
430    #[open_protocol_field(list, amount = "number_of_pids")]
431    pub data_fields: Vec<DataField>,
432
433    /// The trace type identifier.
434    #[open_protocol_field(length = 2)]
435    pub trace_type: TraceType,
436
437    /// The transducer type used in the trace.
438    #[open_protocol_field(length = 2)]
439    pub transducer_type: u8,
440
441    /// The unit of measurement for the trace.
442    #[open_protocol_field(length = 3)]
443    pub unit: u16,
444
445    /// The number of parameter fields.
446    #[open_protocol_field(length = 3)]
447    pub number_of_parameter_fields: u16,
448
449    /// Parameter fields for time intervals.
450    #[open_protocol_field(list, amount = "number_of_parameter_fields")]
451    pub parameter_fields: Vec<DataField>,
452
453    /// The number of resolution fields.
454    #[open_protocol_field(length = 3)]
455    pub number_of_resolution_fields: u16,
456
457    /// Resolution fields for time intervals.
458    #[open_protocol_field(list, amount = "number_of_resolution_fields")]
459    pub resolution_fields: Vec<DataField>,
460
461    /// The number of trace samples included.
462    #[open_protocol_field(length = 5)]
463    pub number_of_trace_samples: u32,
464
465    /// NUL character (0x00) separating text from binary data.
466    #[open_protocol_field(length = 1)]
467    pub nul_character: u8,
468
469    /// The trace samples (binary values).
470    #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
471    pub trace_samples: Vec<TraceSample>,
472}
473
474#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
475#[open_protocol_message(MID = 0900, revision = 2)]
476pub struct MID0900rev2 {
477    /// The unique identifier for the result data.
478    #[open_protocol_field(length = 10)]
479    pub result_data_id: u32,
480
481    /// Timestamp of when the trace was recorded.
482    #[open_protocol_field(length = 19)]
483    pub timestamp: DateTime<Local>,
484
485    /// The number of PIDs (parameter data fields).
486    #[open_protocol_field(length = 3)]
487    pub number_of_pids: u16,
488
489    /// Data fields (list of parameter values).
490    #[open_protocol_field(list, amount = "number_of_pids")]
491    pub data_fields: Vec<DataField>,
492
493    /// The trace type identifier.
494    #[open_protocol_field(length = 2)]
495    pub trace_type: TraceType,
496
497    /// The transducer type used in the trace.
498    #[open_protocol_field(length = 2)]
499    pub transducer_type: u8,
500
501    /// The unit of measurement for the trace.
502    #[open_protocol_field(length = 3)]
503    pub unit: u16,
504
505    /// The MID of the request that this message is a response to.
506    /// Typically 0008 (subscribe) or 0006 (data upload).
507    #[open_protocol_field(length = 4)]
508    pub request_mid: u16,
509
510    /// The number of parameter fields.
511    #[open_protocol_field(length = 3)]
512    pub number_of_parameter_fields: u16,
513
514    /// Parameter fields for time intervals.
515    #[open_protocol_field(list, amount = "number_of_parameter_fields")]
516    pub parameter_fields: Vec<DataField>,
517
518    /// The number of resolution fields.
519    #[open_protocol_field(length = 3)]
520    pub number_of_resolution_fields: u16,
521
522    /// Resolution fields for time intervals.
523    #[open_protocol_field(list, amount = "number_of_resolution_fields")]
524    pub resolution_fields: Vec<DataField>,
525
526    /// The number of trace samples included.
527    #[open_protocol_field(length = 5)]
528    pub number_of_trace_samples: u32,
529
530    /// NUL character (0x00) separating text from binary data.
531    #[open_protocol_field(length = 1)]
532    pub nul_character: u8,
533
534    /// The trace samples (binary values).
535    #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
536    pub trace_samples: Vec<TraceSample>,
537}
538
539#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
540#[open_protocol_message(MID = 0900, revision = 3)]
541pub struct MID0900rev3 {
542    /// The unique identifier for the result data.
543    #[open_protocol_field(length = 10)]
544    pub result_data_id: u32,
545
546    /// Timestamp of when the trace was recorded.
547    #[open_protocol_field(length = 19)]
548    pub timestamp: DateTime<Local>,
549
550    /// The user defined object ID
551    #[open_protocol_field(length = 4)]
552    pub object_id: u16,
553
554    /// The type of the object
555    #[open_protocol_field(length = 1)]
556    pub object_type: ObjectType,
557
558    /// Link to related Object ID
559    #[open_protocol_field(length = 4)]
560    pub reference_object_id: u16,
561
562    /// The number of PIDs (parameter data fields).
563    #[open_protocol_field(length = 3)]
564    pub number_of_pids: u16,
565
566    /// Data fields (list of parameter values).
567    #[open_protocol_field(list, amount = "number_of_pids")]
568    pub data_fields: Vec<DataField>,
569
570    /// The trace type identifier.
571    #[open_protocol_field(length = 2)]
572    pub trace_type: TraceType,
573
574    /// The transducer type used in the trace.
575    #[open_protocol_field(length = 2)]
576    pub transducer_type: u8,
577
578    /// The unit of measurement for the trace.
579    #[open_protocol_field(length = 3)]
580    pub unit: u16,
581
582    /// The MID of the request that this message is a response to.
583    /// Typically 0008 (subscribe) or 0006 (data upload).
584    #[open_protocol_field(length = 4)]
585    pub request_mid: u16,
586
587    /// The number of parameter fields.
588    #[open_protocol_field(length = 3)]
589    pub number_of_parameter_fields: u16,
590
591    /// Parameter fields for time intervals.
592    #[open_protocol_field(list, amount = "number_of_parameter_fields")]
593    pub parameter_fields: Vec<DataField>,
594
595    /// The number of resolution fields.
596    #[open_protocol_field(length = 3)]
597    pub number_of_resolution_fields: u16,
598
599    /// Resolution fields for time intervals.
600    #[open_protocol_field(list, amount = "number_of_resolution_fields")]
601    pub resolution_fields: Vec<DataField>,
602
603    /// The number of trace samples included.
604    #[open_protocol_field(length = 5)]
605    pub number_of_trace_samples: u32,
606
607    /// NUL character (0x00) separating text from binary data.
608    #[open_protocol_field(length = 1)]
609    pub nul_character: u8,
610
611    /// The trace samples (binary values).
612    #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
613    pub trace_samples: Vec<TraceSample>,
614}
615
616#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
617pub struct MID0900RequestExtraData {
618    /// The index of the requested tightening result. If equal to zero, response
619    /// will contain the most recent result.
620    #[open_protocol_field(length = 10)]
621    pub index: u64,
622
623    /// Type of the trace requested.
624    #[open_protocol_field(length = 3)]
625    pub trace_type: TraceType,
626
627    /// The number of the tool.
628    #[open_protocol_field(length = 4)]
629    pub tool_number: u16,
630}
631
632#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
633pub struct MID0900SubscribeExtraData {
634    // TODO
635}
636
637#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
638pub struct MID0900UnsubscribeExtraData {
639    // TODO
640}
641
642/// Subscribe, MID 0901 Trace plotting parameter
643#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
644#[open_protocol_message(MID = 0901, revision = 1)]
645pub struct MID0901rev1 {
646    // TODO
647}
648
649/// Subscribe, MID 0901 Trace plotting parameter
650#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
651#[open_protocol_message(MID = 0901, revision = 2)]
652pub struct MID0901rev2 {
653    // TODO
654}
655
656/// Subscribe, MID 0901 Trace plotting parameter
657#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
658#[open_protocol_message(MID = 0901, revision = 3)]
659pub struct MID0901rev3 {
660    // TODO
661}
662
663/// 5.8.11 MID 0902 Tightening Result DB Info Upload
664#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
665#[open_protocol_message(MID = 0902, revision = 1)]
666pub struct MID0902rev1 {
667    /// The total number of tightening results that can be stored.
668    #[open_protocol_field(length = 10)]
669    pub capacity: u64,
670
671    /// The sequence number of the oldest tightening result currently in the database.
672    #[open_protocol_field(length = 10)]
673    pub oldest_sequence_number: u64,
674
675    /// The start time of the oldest tightening result currently in the database.
676    #[open_protocol_field(length = 19)]
677    pub oldest_time: DateTime<Local>,
678
679    /// The sequence number of the newest tightening result currently in the database.
680    #[open_protocol_field(length = 10)]
681    pub newest_sequence_number: u64,
682
683    /// The start time of the newest tightening result currently in the database.
684    #[open_protocol_field(length = 19)]
685    pub newest_time: DateTime<Local>,
686
687    /// The number of PIDs (parameter data fields).
688    #[open_protocol_field(length = 3)]
689    pub number_of_pids: u16,
690
691    /// Data fields (list of parameter values).
692    #[open_protocol_field(list, amount = "number_of_pids")]
693    pub data_fields: Vec<DataField>,
694}