|
1 # |
|
2 # Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024. |
|
3 # |
|
4 # AUTOGENERATED - DO NOT EDIT |
|
5 # |
|
6 |
|
7 |
|
8 # Enumerators data types declarations |
|
9 class PLCstatus_enum: |
|
10 Empty = 0 |
|
11 Stopped = 1 |
|
12 Started = 2 |
|
13 Broken = 3 |
|
14 Disconnected = 4 |
|
15 |
|
16 |
|
17 # Structures data types declarations |
|
18 class log_message(object): |
|
19 def __init__(self, msg=None, tick=None, sec=None, nsec=None): |
|
20 self.msg = msg # string |
|
21 self.tick = tick # uint32 |
|
22 self.sec = sec # uint32 |
|
23 self.nsec = nsec # uint32 |
|
24 |
|
25 def _read(self, codec): |
|
26 self.msg = codec.read_string() |
|
27 self.tick = codec.read_uint32() |
|
28 self.sec = codec.read_uint32() |
|
29 self.nsec = codec.read_uint32() |
|
30 return self |
|
31 |
|
32 def _write(self, codec): |
|
33 if self.msg is None: |
|
34 raise ValueError("msg is None") |
|
35 codec.write_string(self.msg) |
|
36 if self.tick is None: |
|
37 raise ValueError("tick is None") |
|
38 codec.write_uint32(self.tick) |
|
39 if self.sec is None: |
|
40 raise ValueError("sec is None") |
|
41 codec.write_uint32(self.sec) |
|
42 if self.nsec is None: |
|
43 raise ValueError("nsec is None") |
|
44 codec.write_uint32(self.nsec) |
|
45 |
|
46 def __str__(self): |
|
47 return "<%s@%x msg=%s tick=%s sec=%s nsec=%s>" % (self.__class__.__name__, id(self), self.msg, self.tick, self.sec, self.nsec) |
|
48 |
|
49 def __repr__(self): |
|
50 return self.__str__() |
|
51 |
|
52 class PSKID(object): |
|
53 def __init__(self, ID=None, PSK=None): |
|
54 self.ID = ID # string |
|
55 self.PSK = PSK # string |
|
56 |
|
57 def _read(self, codec): |
|
58 self.ID = codec.read_string() |
|
59 self.PSK = codec.read_string() |
|
60 return self |
|
61 |
|
62 def _write(self, codec): |
|
63 if self.ID is None: |
|
64 raise ValueError("ID is None") |
|
65 codec.write_string(self.ID) |
|
66 if self.PSK is None: |
|
67 raise ValueError("PSK is None") |
|
68 codec.write_string(self.PSK) |
|
69 |
|
70 def __str__(self): |
|
71 return "<%s@%x ID=%s PSK=%s>" % (self.__class__.__name__, id(self), self.ID, self.PSK) |
|
72 |
|
73 def __repr__(self): |
|
74 return self.__str__() |
|
75 |
|
76 class PLCstatus(object): |
|
77 def __init__(self, PLCstatus=None, logcounts=None): |
|
78 self.PLCstatus = PLCstatus # PLCstatus_enum |
|
79 self.logcounts = logcounts # uint32[4] |
|
80 |
|
81 |
|
82 def _read(self, codec): |
|
83 self.PLCstatus = codec.read_int32() |
|
84 self.logcounts = [] |
|
85 for _i0 in range(4): |
|
86 _v0 = codec.read_uint32() |
|
87 self.logcounts.append(_v0) |
|
88 |
|
89 return self |
|
90 |
|
91 def _write(self, codec): |
|
92 if self.PLCstatus is None: |
|
93 raise ValueError("PLCstatus is None") |
|
94 codec.write_int32(self.PLCstatus) |
|
95 if self.logcounts is None: |
|
96 raise ValueError("logcounts is None") |
|
97 for _i0 in self.logcounts: |
|
98 codec.write_uint32(_i0) |
|
99 |
|
100 |
|
101 def __str__(self): |
|
102 return "<%s@%x PLCstatus=%s logcounts=%s>" % (self.__class__.__name__, id(self), self.PLCstatus, self.logcounts) |
|
103 |
|
104 def __repr__(self): |
|
105 return self.__str__() |
|
106 |
|
107 class trace_sample(object): |
|
108 def __init__(self, tick=None, TraceBuffer=None): |
|
109 self.tick = tick # uint32 |
|
110 self.TraceBuffer = TraceBuffer # binary |
|
111 |
|
112 def _read(self, codec): |
|
113 self.tick = codec.read_uint32() |
|
114 self.TraceBuffer = codec.read_binary() |
|
115 return self |
|
116 |
|
117 def _write(self, codec): |
|
118 if self.tick is None: |
|
119 raise ValueError("tick is None") |
|
120 codec.write_uint32(self.tick) |
|
121 if self.TraceBuffer is None: |
|
122 raise ValueError("TraceBuffer is None") |
|
123 codec.write_binary(self.TraceBuffer) |
|
124 |
|
125 def __str__(self): |
|
126 return "<%s@%x tick=%s TraceBuffer=%s>" % (self.__class__.__name__, id(self), self.tick, self.TraceBuffer) |
|
127 |
|
128 def __repr__(self): |
|
129 return self.__str__() |
|
130 |
|
131 class TraceVariables(object): |
|
132 def __init__(self, PLCstatus=None, traces=None): |
|
133 self.PLCstatus = PLCstatus # PLCstatus_enum |
|
134 self.traces = traces # list<trace_sample> |
|
135 |
|
136 def _read(self, codec): |
|
137 self.PLCstatus = codec.read_int32() |
|
138 _n0 = codec.start_read_list() |
|
139 self.traces = [] |
|
140 for _i0 in range(_n0): |
|
141 _v0 = trace_sample()._read(codec) |
|
142 self.traces.append(_v0) |
|
143 |
|
144 return self |
|
145 |
|
146 def _write(self, codec): |
|
147 if self.PLCstatus is None: |
|
148 raise ValueError("PLCstatus is None") |
|
149 codec.write_int32(self.PLCstatus) |
|
150 if self.traces is None: |
|
151 raise ValueError("traces is None") |
|
152 codec.start_write_list(len(self.traces)) |
|
153 for _i0 in self.traces: |
|
154 _i0._write(codec) |
|
155 |
|
156 |
|
157 def __str__(self): |
|
158 return "<%s@%x PLCstatus=%s traces=%s>" % (self.__class__.__name__, id(self), self.PLCstatus, self.traces) |
|
159 |
|
160 def __repr__(self): |
|
161 return self.__str__() |
|
162 |
|
163 class extra_file(object): |
|
164 def __init__(self, fname=None, blobID=None): |
|
165 self.fname = fname # string |
|
166 self.blobID = blobID # binary |
|
167 |
|
168 def _read(self, codec): |
|
169 self.fname = codec.read_string() |
|
170 self.blobID = codec.read_binary() |
|
171 return self |
|
172 |
|
173 def _write(self, codec): |
|
174 if self.fname is None: |
|
175 raise ValueError("fname is None") |
|
176 codec.write_string(self.fname) |
|
177 if self.blobID is None: |
|
178 raise ValueError("blobID is None") |
|
179 codec.write_binary(self.blobID) |
|
180 |
|
181 def __str__(self): |
|
182 return "<%s@%x fname=%s blobID=%s>" % (self.__class__.__name__, id(self), self.fname, self.blobID) |
|
183 |
|
184 def __repr__(self): |
|
185 return self.__str__() |
|
186 |
|
187 class trace_order(object): |
|
188 def __init__(self, idx=None, iectype=None, force=None): |
|
189 self.idx = idx # uint32 |
|
190 self.iectype = iectype # uint8 |
|
191 self.force = force # binary |
|
192 |
|
193 def _read(self, codec): |
|
194 self.idx = codec.read_uint32() |
|
195 self.iectype = codec.read_uint8() |
|
196 self.force = codec.read_binary() |
|
197 return self |
|
198 |
|
199 def _write(self, codec): |
|
200 if self.idx is None: |
|
201 raise ValueError("idx is None") |
|
202 codec.write_uint32(self.idx) |
|
203 if self.iectype is None: |
|
204 raise ValueError("iectype is None") |
|
205 codec.write_uint8(self.iectype) |
|
206 if self.force is None: |
|
207 raise ValueError("force is None") |
|
208 codec.write_binary(self.force) |
|
209 |
|
210 def __str__(self): |
|
211 return "<%s@%x idx=%s iectype=%s force=%s>" % (self.__class__.__name__, id(self), self.idx, self.iectype, self.force) |
|
212 |
|
213 def __repr__(self): |
|
214 return self.__str__() |
|
215 |