1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#[derive(Debug, Clone)]
pub struct EtherCatInfo {
pub version: Option<String>,
pub info_reference: Option<String>,
pub vendor: Vendor,
pub description: Description,
}
#[derive(Debug, Clone)]
pub struct Vendor {
pub file_version: Option<u32>,
pub id: u32,
pub name: Option<String>,
pub comment: Option<String>,
pub url: Option<String>,
pub desc_url: Option<String>,
pub image: Option<Image>,
}
#[derive(Debug, Clone, Default)]
pub struct Description {
pub groups: Vec<Group>,
pub devices: Vec<Device>,
pub modules: Vec<Module>,
}
#[derive(Debug, Clone)]
pub enum Image {
Image16x14(String),
ImageFile16x14(String),
ImageData16x14(HexBinary),
}
#[derive(Debug, Clone)]
pub struct Group {
pub sort_order: Option<i32>,
pub parent_group: Option<String>,
pub r#type: String,
pub name: String,
pub comment: Option<String>,
pub image: Option<Image>,
}
#[derive(Debug, Clone)]
pub struct Device {
pub physics: Option<String>,
pub name: String,
pub desc: String,
pub product_code: u32,
pub revision_no: u32,
pub sm: Vec<Sm>,
pub rx_pdo: Vec<Pdo>,
pub tx_pdo: Vec<Pdo>,
}
#[derive(Debug, Clone)]
pub struct Sm {
pub enable: bool,
pub start_address: u16,
pub control_byte: u8,
pub default_size: Option<usize>,
}
#[derive(Debug, Clone)]
pub struct Pdo {
pub sm: usize,
pub fixed: bool,
pub mandatory: bool,
pub index: u16,
pub name: Option<String>,
pub entries: Vec<Entry>,
}
#[derive(Debug, Clone)]
pub struct Sdo {
}
#[derive(Debug, Clone)]
pub struct Entry {
pub index: u16,
pub sub_index: Option<u32>,
pub bit_len: usize,
pub name: Option<String>,
pub data_type: Option<String>,
}
#[derive(Debug, Clone)]
pub struct Module {
pub r#type: String,
pub name: Option<String>,
pub tx_pdo: Option<Pdo>,
pub rx_pdo: Option<Pdo>,
pub mailbox: Mailbox,
pub profile: Profile,
}
#[derive(Debug, Clone)]
pub struct Mailbox {
}
#[derive(Debug, Clone)]
pub struct Profile {
}
#[derive(Debug, Clone, PartialEq)]
pub struct HexBinary(pub String);