1use chrono::{DateTime, Local};
2use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
3
4#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
5pub enum ToolReadyStatus {
6 #[default]
7 #[open_protocol_value(number = 0)]
8 NOK,
9 #[open_protocol_value(number = 1)]
10 OK
11}
12
13#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
14pub enum ControllerReadyStatus {
15 #[default]
16 #[open_protocol_value(number = 0)]
17 NOK,
18 #[open_protocol_value(number = 1)]
19 OK
20}
21
22#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
23pub enum AlarmStatus {
24 #[default]
25 #[open_protocol_value(number = 0)]
26 NoAlarm,
27 #[open_protocol_value(number = 1)]
28 AlarmActive
29}
30
31#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
33#[open_protocol_message(MID = 70, revision = 1)]
34pub struct MID0070rev1 {
35 }
37
38#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
41#[open_protocol_message(MID = 71, revision = 1)]
42pub struct MID0071rev1 {
43 #[open_protocol_field(length = 4)]
45 pub error_code: String,
46
47 #[open_protocol_field(length = 1)]
49 pub controller_ready_status: ControllerReadyStatus,
50
51 #[open_protocol_field(length = 1)]
53 pub tool_ready_status: ToolReadyStatus,
54
55 #[open_protocol_field(length = 19)]
57 pub timestamp: DateTime<Local>,
58}
59
60#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
62#[open_protocol_message(MID = 72, revision = 1)]
63pub struct MID0072rev1 {
64 }
66
67#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
69#[open_protocol_message(MID = 73, revision = 1)]
70pub struct MID0073rev1 {
71 }
73
74#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
76#[open_protocol_message(MID = 74, revision = 1)]
77pub struct MID0074rev1 {
78 #[open_protocol_field(length = 4)]
80 pub error_code: String,
81}
82
83#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
85#[open_protocol_message(MID = 75, revision = 1)]
86pub struct MID0075rev1 {
87 }
89
90#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
93#[open_protocol_message(MID = 76, revision = 1)]
94pub struct MID0076rev1 {
95 #[open_protocol_field(length = 1)]
97 pub alarm_status: AlarmStatus,
98
99 #[open_protocol_field(length = 4)]
101 pub error_code: String,
102
103 #[open_protocol_field(length = 1)]
105 pub controller_ready_status: ControllerReadyStatus,
106
107 #[open_protocol_field(length = 1)]
109 pub tool_ready_status: ToolReadyStatus,
110
111 #[open_protocol_field(length = 19)]
113 pub timestamp: DateTime<Local>,
114}
115
116#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
118#[open_protocol_message(MID = 77, revision = 1)]
119pub struct MID0077rev1 {
120 }
122
123#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
125#[open_protocol_message(MID = 78, revision = 1)]
126pub struct MID0078rev1 {
127 #[open_protocol_field(length = 4)]
129 pub error_code: String,
130}
131
132#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
135#[open_protocol_message(MID = 1000, revision = 1)]
136pub struct MID1000rev1 {
137 #[open_protocol_field(length = 5)]
139 pub error_code: String,
140
141 #[open_protocol_field(length = 19)]
143 pub timestamp: DateTime<Local>,
144
145 #[open_protocol_field(length = 3)]
147 pub number_of_data_fields: u16,
148
149 #[open_protocol_field(list, amount = "number_of_data_fields")]
151 pub data_fields: Vec<u8>,
152}
153
154#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
156#[open_protocol_message(MID = 1001, revision = 1)]
157pub struct MID1001rev1 {
158 }