use chrono::{DateTime, Local};
use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 40, revision = 6)]
pub struct MID0040rev6 {
#[open_protocol_field(length = 4)]
pub tool_number: u16,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 41, revision = 1)]
pub struct MID0041rev1 {
#[open_protocol_field(length = 14)]
pub tool_serial_number: String,
#[open_protocol_field(length = 10)]
pub number_of_tightenings: u32,
#[open_protocol_field(length = 19)]
pub last_calibration_date: DateTime<Local>,
#[open_protocol_field(length = 10)]
pub controller_serial_number: String,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 41, revision = 2)]
pub struct MID0041rev2 {
#[open_protocol_field(length = 14)]
pub tool_serial_number: String,
#[open_protocol_field(length = 10)]
pub number_of_tightenings: u32,
#[open_protocol_field(length = 19)]
pub last_calibration_date: DateTime<Local>,
#[open_protocol_field(length = 10)]
pub controller_serial_number: String,
#[open_protocol_field(length = 6)]
pub calibration_value: u32,
#[open_protocol_field(length = 19)]
pub last_service_date: DateTime<Local>,
#[open_protocol_field(length = 10)]
pub tightenings_since_service: u32,
#[open_protocol_field(length = 2)]
pub tool_type: u8,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 42, revision = 2)]
pub struct MID0042rev2 {
#[open_protocol_field(length = 4)]
pub tool_number: u16,
#[open_protocol_field(length = 2)]
pub disable_type: u8,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 43, revision = 2)]
pub struct MID0043rev2 {
#[open_protocol_field(length = 4)]
pub tool_number: u16,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 44, revision = 1)]
pub struct MID0044rev1 {
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 45, revision = 1)]
pub struct MID0045rev1 {
#[open_protocol_field(length = 1)]
pub calibration_value_unit: u8,
#[open_protocol_field(length = 6)]
pub calibration_value: u32,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 45, revision = 2)]
pub struct MID0045rev2 {
#[open_protocol_field(length = 1)]
pub calibration_value_unit: u8,
#[open_protocol_field(length = 6)]
pub calibration_value: u32,
#[open_protocol_field(length = 2)]
pub channel_number: u8,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 46, revision = 1)]
pub struct MID0046rev1 {
#[open_protocol_field(length = 2)]
pub primary_tool: u8,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 47, revision = 1)]
pub struct MID0047rev1 {
#[open_protocol_field(length = 2)]
pub pairing_handling_type: u8,
}
#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
#[open_protocol_message(MID = 48, revision = 1)]
pub struct MID0048rev1 {
#[open_protocol_field(length = 2)]
pub pairing_status: u8,
#[open_protocol_field(length = 19)]
pub timestamp: DateTime<Local>,
}