1use chrono::{DateTime, Local};
2use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
3
4#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
5#[open_protocol_message(MID = 40, revision = 6)]
6pub struct MID0040rev6 {
7 #[open_protocol_field(length = 4)]
9 pub tool_number: u16,
10}
11
12#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
13#[open_protocol_message(MID = 41, revision = 1)]
14pub struct MID0041rev1 {
15 #[open_protocol_field(length = 14)]
17 pub tool_serial_number: String,
18
19 #[open_protocol_field(length = 10)]
21 pub number_of_tightenings: u32,
22
23 #[open_protocol_field(length = 19)]
25 pub last_calibration_date: DateTime<Local>,
26
27 #[open_protocol_field(length = 10)]
29 pub controller_serial_number: String,
30}
31
32#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
33#[open_protocol_message(MID = 41, revision = 2)]
34pub struct MID0041rev2 {
35 #[open_protocol_field(length = 14)]
37 pub tool_serial_number: String,
38
39 #[open_protocol_field(length = 10)]
41 pub number_of_tightenings: u32,
42
43 #[open_protocol_field(length = 19)]
45 pub last_calibration_date: DateTime<Local>,
46
47 #[open_protocol_field(length = 10)]
49 pub controller_serial_number: String,
50
51 #[open_protocol_field(length = 6)]
53 pub calibration_value: u32,
54
55 #[open_protocol_field(length = 19)]
57 pub last_service_date: DateTime<Local>,
58
59 #[open_protocol_field(length = 10)]
61 pub tightenings_since_service: u32,
62
63 #[open_protocol_field(length = 2)]
65 pub tool_type: u8,
66}
67
68#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
69#[open_protocol_message(MID = 42, revision = 2)]
70pub struct MID0042rev2 {
71 #[open_protocol_field(length = 4)]
73 pub tool_number: u16,
74
75 #[open_protocol_field(length = 2)]
77 pub disable_type: u8,
78}
79
80#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
81#[open_protocol_message(MID = 43, revision = 2)]
82pub struct MID0043rev2 {
83 #[open_protocol_field(length = 4)]
85 pub tool_number: u16,
86}
87
88#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
89#[open_protocol_message(MID = 44, revision = 1)]
90pub struct MID0044rev1 {
91 }
93
94#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
95#[open_protocol_message(MID = 45, revision = 1)]
96pub struct MID0045rev1 {
97 #[open_protocol_field(length = 1)]
99 pub calibration_value_unit: u8,
100
101 #[open_protocol_field(length = 6)]
103 pub calibration_value: u32,
104}
105
106#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
107#[open_protocol_message(MID = 45, revision = 2)]
108pub struct MID0045rev2 {
109 #[open_protocol_field(length = 1)]
111 pub calibration_value_unit: u8,
112
113 #[open_protocol_field(length = 6)]
115 pub calibration_value: u32,
116
117 #[open_protocol_field(length = 2)]
119 pub channel_number: u8,
120}
121
122#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
123#[open_protocol_message(MID = 46, revision = 1)]
124pub struct MID0046rev1 {
125 #[open_protocol_field(length = 2)]
127 pub primary_tool: u8,
128}
129
130#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
131#[open_protocol_message(MID = 47, revision = 1)]
132pub struct MID0047rev1 {
133 #[open_protocol_field(length = 2)]
135 pub pairing_handling_type: u8,
136}
137
138#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
139#[open_protocol_message(MID = 48, revision = 1)]
140pub struct MID0048rev1 {
141 #[open_protocol_field(length = 2)]
143 pub pairing_status: u8,
144
145 #[open_protocol_field(length = 19)]
147 pub timestamp: DateTime<Local>,
148}