pyxcp 0.22.30__cp38-cp38-win_amd64.whl → 0.22.32__cp38-cp38-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyxcp might be problematic. Click here for more details.

pyxcp/__init__.py CHANGED
@@ -17,4 +17,4 @@ tb_install(show_locals=True, max_frames=3) # Install custom exception handler.
17
17
 
18
18
  # if you update this manually, do not forget to update
19
19
  # .bumpversion.cfg and pyproject.toml.
20
- __version__ = "0.22.30"
20
+ __version__ = "0.22.32"
Binary file
@@ -40,6 +40,7 @@ PYBIND11_MODULE(cpp_ext, m) {
40
40
  .def_property_readonly("components", &McObject::get_components)
41
41
 
42
42
  .def("add_component", &McObject::add_component, "component"_a)
43
+ .def("__eq__", [](const McObject& self, const McObject& other) { return self == other; })
43
44
  .def("__repr__", [](const McObject& self) { return to_string(self); })
44
45
  .def("__hash__", [](const McObject& self) { return self.get_hash(); })
45
46
  ;
@@ -218,8 +218,8 @@ class DaqToCsv(DaqOnlinePolicy):
218
218
  hdr = ",".join(["timestamp0", "timestamp1"] + [h[0] for h in daq_list.headers])
219
219
  out_file.write(f"{hdr}\n")
220
220
 
221
- def on_daq_list(self, daq_list: int, ts0: int, ts1: int, payload: list):
222
- self.files[daq_list].write(f"{ts0},{ts1},{', '.join([str(x) for x in payload])}\n")
221
+ def on_daq_list(self, daq_list: int, timestamp0: int, timestamp1: int, payload: list):
222
+ self.files[daq_list].write(f"{timestamp0},{timestamp1},{', '.join([str(x) for x in payload])}\n")
223
223
 
224
224
  def finalize(self):
225
225
  self.log.debug("DaqCsv::finalize()")
Binary file
pyxcp/master/master.py CHANGED
@@ -694,7 +694,7 @@ class Master:
694
694
  callback_remaining = total_length
695
695
  for _ in chunks:
696
696
  block = data[offset : offset + max_payload]
697
- dl_func(block, max_payload, last=True)
697
+ dl_func(block, max_payload, last=False)
698
698
  offset += max_payload
699
699
  callback_remaining -= chunk_size
700
700
  if callback and callback_remaining <= total_length - (total_length / 100) * percent_complete:
@@ -1328,7 +1328,7 @@ class Master:
1328
1328
  if wait_for_optional_response:
1329
1329
  return self.transport.request_optional_response(types.Command.PROGRAM_RESET)
1330
1330
  else:
1331
- return self.transport.block_request(types.Command.PROGRAM_RESET)
1331
+ return self.transport.request(types.Command.PROGRAM_RESET)
1332
1332
 
1333
1333
  @wrapped
1334
1334
  def getPgmProcessorInfo(self):
@@ -98,8 +98,8 @@ class Storage:
98
98
  class StorageContainer:
99
99
  name: str
100
100
  arr: List[Storage] = field(default_factory=[])
101
- ts0: List[int] = field(default_factory=lambda: array("Q"))
102
- ts1: List[int] = field(default_factory=lambda: array("Q"))
101
+ timestamp0: List[int] = field(default_factory=lambda: array("Q"))
102
+ timestamp1: List[int] = field(default_factory=lambda: array("Q"))
103
103
 
104
104
 
105
105
  class XcpLogFileDecoder(_XcpLogFileDecoder):
@@ -158,8 +158,8 @@ class CollectRows:
158
158
 
159
159
  def on_daq_list(self, daq_list_num: int, timestamp0: int, timestamp1: int, measurements: list) -> None:
160
160
  storage_container = self.tables[daq_list_num]
161
- storage_container.ts0.append(timestamp0)
162
- storage_container.ts1.append(timestamp1)
161
+ storage_container.timestamp0.append(timestamp0)
162
+ storage_container.timestamp1.append(timestamp1)
163
163
  for idx, elem in enumerate(measurements):
164
164
  storage = storage_container.arr[idx]
165
165
  storage.arr.append(elem)
@@ -198,8 +198,8 @@ class ArrowConverter(CollectRows, XcpLogFileDecoder):
198
198
  def on_finalize(self) -> None:
199
199
  result = []
200
200
  for arr in self.tables:
201
- timestamp0 = arr.ts0
202
- timestamp1 = arr.ts1
201
+ timestamp0 = arr.timestamp0
202
+ timestamp1 = arr.timestamp1
203
203
  names = ["timestamp0", "timestamp1"]
204
204
  data = [timestamp0, timestamp1]
205
205
  for sd in arr.arr:
@@ -229,7 +229,7 @@ class CsvConverter(XcpLogFileDecoder):
229
229
  fname = f"{sc.name}{self.out_file_suffix}"
230
230
  self.logger.info(f"Creating file {fname!r}.")
231
231
  writer = csv.writer(open(fname, "w", newline=""), dialect="excel")
232
- headers = ["ts0", "ts1"] + [e.name for e in sc.arr]
232
+ headers = ["timestamp0", "timestamp1"] + [e.name for e in sc.arr]
233
233
  writer.writerow(headers)
234
234
  self.csv_writers.append(writer)
235
235
 
@@ -257,7 +257,7 @@ class ExcelConverter(XcpLogFileDecoder):
257
257
  def on_container(self, sc: StorageContainer) -> None:
258
258
  sheet = self.xls_workbook.add_worksheet(sc.name)
259
259
  self.xls_sheets.append(sheet)
260
- headers = ["ts0", "ts1"] + [e.name for e in sc.arr]
260
+ headers = ["timestamp0", "timestamp1"] + [e.name for e in sc.arr]
261
261
  sheet.write_row(0, 0, headers)
262
262
  self.rows.append(1)
263
263
 
@@ -285,8 +285,8 @@ class HdfConverter(CollectRows, XcpLogFileDecoder):
285
285
 
286
286
  def on_finalize(self) -> None:
287
287
  for arr in self.tables:
288
- timestamp0 = arr.ts0
289
- timestamp1 = arr.ts1
288
+ timestamp0 = arr.timestamp0
289
+ timestamp1 = arr.timestamp1
290
290
  self.out_file[f"/{arr.name}/timestamp0"] = timestamp0
291
291
  self.out_file[f"/{arr.name}/timestamp1"] = timestamp1
292
292
  for sd in arr.arr:
@@ -322,7 +322,7 @@ class MdfConverter(CollectRows, XcpLogFileDecoder):
322
322
  mdf4.header = hdr
323
323
  for idx, arr in enumerate(self.tables):
324
324
  signals = []
325
- timestamps = arr.ts0
325
+ timestamps = arr.timestamp0
326
326
  for sd in arr.arr:
327
327
  signal = Signal(samples=sd.arr, name=sd.name, timestamps=timestamps)
328
328
  signals.append(signal)
@@ -369,7 +369,7 @@ class SqliteConverter(XcpLogFileDecoder):
369
369
  self.create_table(sc)
370
370
  self.logger.info(f"Creating table {sc.name!r}.")
371
371
  self.insert_stmt[sc.name] = (
372
- f"""INSERT INTO {sc.name}({', '.join(['ts0', 'ts1'] + [r.name for r in sc.arr])}) VALUES({', '.join(["?" for _ in range(len(sc.arr) + 2)])})"""
372
+ f"""INSERT INTO {sc.name}({', '.join(['timestamp0', 'timestamp1'] + [r.name for r in sc.arr])}) VALUES({', '.join(["?" for _ in range(len(sc.arr) + 2)])})"""
373
373
  )
374
374
 
375
375
  def on_finalize(self) -> None:
@@ -403,7 +403,7 @@ class SqliteConverter(XcpLogFileDecoder):
403
403
  )
404
404
 
405
405
  def create_table(self, sc: StorageContainer) -> None:
406
- columns = ["ts0 INTEGER", "ts1 INTEGER"]
406
+ columns = ["timestamp0 INTEGER", "timestamp1 INTEGER"]
407
407
  for elem in sc.arr:
408
408
  columns.append(f"{elem.name} {elem.target_type}")
409
409
  ddl = f"CREATE TABLE {sc.name}({', '.join(columns)})"
Binary file
@@ -0,0 +1,426 @@
1
+ #!/usr/bin/env python
2
+
3
+ import pytest
4
+
5
+ from pyxcp.cpp_ext.cpp_ext import Bin, DaqList, McObject # # noqa: F401
6
+ from pyxcp.daq_stim.optimize import make_continuous_blocks
7
+ from pyxcp.daq_stim.optimize.binpacking import first_fit_decreasing
8
+
9
+
10
+ DAQ_LISTS_1 = [
11
+ DaqList(
12
+ "test",
13
+ 0,
14
+ False,
15
+ False,
16
+ [
17
+ ("voltage1", 0x0080051A - 4, 0, "F32"), # 80053a
18
+ ("voltage2", 0x0080051E - 4, 0, "F32"),
19
+ ("voltage3", 0x00800522 - 4, 0, "F32"),
20
+ ("voltage4", 0x00800526 - 4, 0, "F32"),
21
+ ("sine_wave", 0x00800512, 0, "F32"),
22
+ ],
23
+ ),
24
+ ]
25
+
26
+ DAQ_LISTS_2 = [
27
+ DaqList(
28
+ "test",
29
+ 0,
30
+ False,
31
+ False,
32
+ [
33
+ ("voltage1", 0x0080051A, 0, "F32"), # 80053a
34
+ ("voltage2", 0x0080051E, 0, "F32"),
35
+ ("voltage3", 0x00800522, 0, "F32"),
36
+ ("voltage4", 0x00800526, 0, "F32"),
37
+ ("sq0", 0x00800516, 0, "U8"),
38
+ ("sq1", 0x00800517, 0, "U8"),
39
+ ("sine_wave", 0x00800512, 0, "F32"),
40
+ ],
41
+ ),
42
+ ]
43
+
44
+ max_payload_size = 64
45
+ max_payload_size_first = 64
46
+
47
+ EXPECTED_BLOCK_VAR_1_64 = [
48
+ McObject(
49
+ name="",
50
+ address=8389906,
51
+ ext=0,
52
+ data_type="",
53
+ length=20,
54
+ components=[
55
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
56
+ McObject(name="voltage1", address=8389910, ext=0, data_type="F32", length=4, components=[]),
57
+ McObject(name="voltage2", address=8389914, ext=0, data_type="F32", length=4, components=[]),
58
+ McObject(name="voltage3", address=8389918, ext=0, data_type="F32", length=4, components=[]),
59
+ McObject(name="voltage4", address=8389922, ext=0, data_type="F32", length=4, components=[]),
60
+ ],
61
+ )
62
+ ]
63
+
64
+ EXPECTED_BLOCK_VAR_1_8 = [
65
+ McObject(
66
+ name="",
67
+ address=8389906,
68
+ ext=0,
69
+ data_type="",
70
+ length=4,
71
+ components=[McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[])],
72
+ ),
73
+ McObject(
74
+ name="",
75
+ address=8389910,
76
+ ext=0,
77
+ data_type="",
78
+ length=4,
79
+ components=[McObject(name="voltage1", address=8389910, ext=0, data_type="F32", length=4, components=[])],
80
+ ),
81
+ McObject(
82
+ name="",
83
+ address=8389914,
84
+ ext=0,
85
+ data_type="",
86
+ length=4,
87
+ components=[McObject(name="voltage2", address=8389914, ext=0, data_type="F32", length=4, components=[])],
88
+ ),
89
+ McObject(
90
+ name="",
91
+ address=8389918,
92
+ ext=0,
93
+ data_type="",
94
+ length=4,
95
+ components=[McObject(name="voltage3", address=8389918, ext=0, data_type="F32", length=4, components=[])],
96
+ ),
97
+ McObject(
98
+ name="",
99
+ address=8389922,
100
+ ext=0,
101
+ data_type="",
102
+ length=4,
103
+ components=[McObject(name="voltage4", address=8389922, ext=0, data_type="F32", length=4, components=[])],
104
+ ),
105
+ ]
106
+
107
+ EXPECTED_BLOCK_VAR_2_64 = [
108
+ McObject(
109
+ name="",
110
+ address=8389906,
111
+ ext=0,
112
+ data_type="",
113
+ length=6,
114
+ components=[
115
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
116
+ McObject(name="sq0", address=8389910, ext=0, data_type="U8", length=1, components=[]),
117
+ McObject(name="sq1", address=8389911, ext=0, data_type="U8", length=1, components=[]),
118
+ ],
119
+ ),
120
+ McObject(
121
+ name="",
122
+ address=8389914,
123
+ ext=0,
124
+ data_type="",
125
+ length=16,
126
+ components=[
127
+ McObject(name="voltage1", address=8389914, ext=0, data_type="F32", length=4, components=[]),
128
+ McObject(name="voltage2", address=8389918, ext=0, data_type="F32", length=4, components=[]),
129
+ McObject(name="voltage3", address=8389922, ext=0, data_type="F32", length=4, components=[]),
130
+ McObject(name="voltage4", address=8389926, ext=0, data_type="F32", length=4, components=[]),
131
+ ],
132
+ ),
133
+ ]
134
+
135
+ EXPECTED_BLOCK_VAR_2_8 = [
136
+ McObject(
137
+ name="",
138
+ address=8389906,
139
+ ext=0,
140
+ data_type="",
141
+ length=6,
142
+ components=[
143
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
144
+ McObject(name="sq0", address=8389910, ext=0, data_type="U8", length=1, components=[]),
145
+ McObject(name="sq1", address=8389911, ext=0, data_type="U8", length=1, components=[]),
146
+ ],
147
+ ),
148
+ McObject(
149
+ name="",
150
+ address=8389914,
151
+ ext=0,
152
+ data_type="",
153
+ length=4,
154
+ components=[
155
+ McObject(name="voltage1", address=8389914, ext=0, data_type="F32", length=4, components=[]),
156
+ ],
157
+ ),
158
+ McObject(
159
+ name="",
160
+ address=8389918,
161
+ ext=0,
162
+ data_type="",
163
+ length=4,
164
+ components=[
165
+ McObject(name="voltage2", address=8389918, ext=0, data_type="F32", length=4, components=[]),
166
+ ],
167
+ ),
168
+ McObject(
169
+ name="",
170
+ address=8389922,
171
+ ext=0,
172
+ data_type="",
173
+ length=4,
174
+ components=[
175
+ McObject(name="voltage3", address=8389922, ext=0, data_type="F32", length=4, components=[]),
176
+ ],
177
+ ),
178
+ McObject(
179
+ name="",
180
+ address=8389926,
181
+ ext=0,
182
+ data_type="",
183
+ length=4,
184
+ components=[
185
+ McObject(name="voltage4", address=8389926, ext=0, data_type="F32", length=4, components=[]),
186
+ ],
187
+ ),
188
+ ]
189
+
190
+ BIN_PACKING_VAR1_8 = (
191
+ (
192
+ 7,
193
+ 3,
194
+ [
195
+ McObject(
196
+ name="",
197
+ address=8389906,
198
+ ext=0,
199
+ data_type="",
200
+ length=4,
201
+ components=[
202
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
203
+ ],
204
+ )
205
+ ],
206
+ ),
207
+ (
208
+ 7,
209
+ 3,
210
+ [
211
+ McObject(
212
+ name="",
213
+ address=8389910,
214
+ ext=0,
215
+ data_type="",
216
+ length=4,
217
+ components=[
218
+ McObject(name="voltage1", address=8389910, ext=0, data_type="F32", length=4, components=[]),
219
+ ],
220
+ )
221
+ ],
222
+ ),
223
+ (
224
+ 7,
225
+ 3,
226
+ [
227
+ McObject(
228
+ name="",
229
+ address=8389914,
230
+ ext=0,
231
+ data_type="",
232
+ length=4,
233
+ components=[
234
+ McObject(name="voltage2", address=8389914, ext=0, data_type="F32", length=4, components=[]),
235
+ ],
236
+ )
237
+ ],
238
+ ),
239
+ (
240
+ 7,
241
+ 3,
242
+ [
243
+ McObject(
244
+ name="",
245
+ address=8389918,
246
+ ext=0,
247
+ data_type="",
248
+ length=4,
249
+ components=[
250
+ McObject(name="voltage3", address=8389918, ext=0, data_type="F32", length=4, components=[]),
251
+ ],
252
+ )
253
+ ],
254
+ ),
255
+ )
256
+
257
+ BIN_PACKING_VAR2_8 = (
258
+ (
259
+ 7,
260
+ 1,
261
+ [
262
+ McObject(
263
+ name="",
264
+ address=8389906,
265
+ ext=0,
266
+ data_type="",
267
+ length=6,
268
+ components=[
269
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
270
+ McObject(name="sq0", address=8389910, ext=0, data_type="U8", length=1, components=[]),
271
+ McObject(name="sq1", address=8389911, ext=0, data_type="U8", length=1, components=[]),
272
+ ],
273
+ )
274
+ ],
275
+ ),
276
+ (
277
+ 7,
278
+ 3,
279
+ [
280
+ McObject(
281
+ name="",
282
+ address=8389914,
283
+ ext=0,
284
+ data_type="",
285
+ length=4,
286
+ components=[
287
+ McObject(name="voltage1", address=8389914, ext=0, data_type="F32", length=4, components=[]),
288
+ ],
289
+ )
290
+ ],
291
+ ),
292
+ (
293
+ 7,
294
+ 3,
295
+ [
296
+ McObject(
297
+ name="",
298
+ address=8389918,
299
+ ext=0,
300
+ data_type="",
301
+ length=4,
302
+ components=[
303
+ McObject(name="voltage2", address=8389918, ext=0, data_type="F32", length=4, components=[]),
304
+ ],
305
+ )
306
+ ],
307
+ ),
308
+ (
309
+ 7,
310
+ 3,
311
+ [
312
+ McObject(
313
+ name="",
314
+ address=8389922,
315
+ ext=0,
316
+ data_type="",
317
+ length=4,
318
+ components=[
319
+ McObject(name="voltage3", address=8389922, ext=0, data_type="F32", length=4, components=[]),
320
+ ],
321
+ )
322
+ ],
323
+ ),
324
+ (
325
+ 7,
326
+ 3,
327
+ [
328
+ McObject(
329
+ name="",
330
+ address=8389926,
331
+ ext=0,
332
+ data_type="",
333
+ length=4,
334
+ components=[
335
+ McObject(name="voltage4", address=8389926, ext=0, data_type="F32", length=4, components=[]),
336
+ ],
337
+ )
338
+ ],
339
+ ),
340
+ )
341
+
342
+ BIN_PACKING_VAR1_64 = (
343
+ (
344
+ 63,
345
+ 43,
346
+ [
347
+ McObject(
348
+ name="",
349
+ address=8389906,
350
+ ext=0,
351
+ data_type="",
352
+ length=20,
353
+ components=[
354
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
355
+ McObject(name="voltage1", address=8389910, ext=0, data_type="F32", length=4, components=[]),
356
+ McObject(name="voltage2", address=8389914, ext=0, data_type="F32", length=4, components=[]),
357
+ McObject(name="voltage3", address=8389918, ext=0, data_type="F32", length=4, components=[]),
358
+ McObject(name="voltage4", address=8389922, ext=0, data_type="F32", length=4, components=[]),
359
+ ],
360
+ )
361
+ ],
362
+ ),
363
+ )
364
+
365
+ BIN_PACKING_VAR2_64 = (
366
+ 63,
367
+ 41,
368
+ [
369
+ McObject(
370
+ name="",
371
+ address=8389914,
372
+ ext=0,
373
+ data_type="",
374
+ length=16,
375
+ components=[
376
+ McObject(name="voltage1", address=8389914, ext=0, data_type="F32", length=4, components=[]),
377
+ McObject(name="voltage2", address=8389918, ext=0, data_type="F32", length=4, components=[]),
378
+ McObject(name="voltage3", address=8389922, ext=0, data_type="F32", length=4, components=[]),
379
+ McObject(name="voltage4", address=8389926, ext=0, data_type="F32", length=4, components=[]),
380
+ ],
381
+ ),
382
+ McObject(
383
+ name="",
384
+ address=8389906,
385
+ ext=0,
386
+ data_type="",
387
+ length=6,
388
+ components=[
389
+ McObject(name="sine_wave", address=8389906, ext=0, data_type="F32", length=4, components=[]),
390
+ McObject(name="sq0", address=8389910, ext=0, data_type="U8", length=1, components=[]),
391
+ McObject(name="sq1", address=8389911, ext=0, data_type="U8", length=1, components=[]),
392
+ ],
393
+ ),
394
+ ],
395
+ )
396
+
397
+
398
+ @pytest.mark.parametrize(
399
+ "daq_lists, expected_blocks, payload_size",
400
+ [
401
+ (DAQ_LISTS_1, EXPECTED_BLOCK_VAR_1_64, 64),
402
+ (DAQ_LISTS_1, EXPECTED_BLOCK_VAR_1_8, 8),
403
+ (DAQ_LISTS_2, EXPECTED_BLOCK_VAR_2_64, 64),
404
+ (DAQ_LISTS_2, EXPECTED_BLOCK_VAR_2_8, 8),
405
+ ],
406
+ )
407
+ def test_make_continuous_blocks(daq_lists, expected_blocks, payload_size):
408
+ daq_list = daq_lists[0]
409
+ blocks = make_continuous_blocks(daq_list.measurements, payload_size - 1, payload_size - 1)
410
+ for block, expected_block in zip(blocks, expected_blocks):
411
+ assert block == expected_block
412
+
413
+
414
+ @pytest.mark.parametrize(
415
+ "blocks, expected_blocks, payload_size",
416
+ [
417
+ (EXPECTED_BLOCK_VAR_1_8, BIN_PACKING_VAR1_8, 8),
418
+ (EXPECTED_BLOCK_VAR_2_8, BIN_PACKING_VAR2_8, 8),
419
+ (EXPECTED_BLOCK_VAR_1_64, BIN_PACKING_VAR1_64, 64),
420
+ (EXPECTED_BLOCK_VAR_2_64, BIN_PACKING_VAR2_64, 64),
421
+ ],
422
+ )
423
+ def test_first_fit_decreasing(blocks, expected_blocks, payload_size):
424
+ res = first_fit_decreasing(blocks, payload_size - 1, payload_size - 1) # noqa: F841
425
+ # for entry in res:
426
+ # print(entry.size, entry.residual_capacity, entry.entries)
@@ -134,7 +134,7 @@ class TestMaster:
134
134
  def testDisconnect(self, eth):
135
135
  with Master("eth", config=create_config()) as xm:
136
136
  xm.transport = eth()
137
- xm.transport.request.return_value = bytes([])
137
+ xm.transport.request_optional_response.return_value = bytes([])
138
138
  res = xm.disconnect()
139
139
  assert res == b""
140
140
 
@@ -1,11 +1,28 @@
1
+ from unittest import mock
2
+
1
3
  import pytest
2
4
 
3
5
  import pyxcp.transport.base as tr
4
6
 
5
7
 
8
+ def create_config():
9
+ # Exception: XCPonEth - Failed to resolve address <MagicMock name='mock.transport.eth.host' id='2414047113872'>:<MagicMock name='mock.transport.eth.port' id='2414047478992'>
10
+ config = mock.MagicMock()
11
+ config.general.return_value = mock.MagicMock()
12
+ config.transport.return_value = mock.MagicMock()
13
+ config.transport.eth.return_value = mock.MagicMock()
14
+ config.transport.eth.host = "localhost"
15
+ config.transport.eth.port = 5555
16
+ config.transport.eth.bind_to_address = ""
17
+ config.transport.eth.bind_to_port = 0
18
+ config.transport.create_daq_timestamps = False
19
+ return config
20
+
21
+
6
22
  def test_factory_works():
7
- assert isinstance(tr.create_transport("eth"), tr.BaseTransport)
8
- assert isinstance(tr.create_transport("sxi"), tr.BaseTransport)
23
+ config = create_config()
24
+ assert isinstance(tr.create_transport("eth", config=config), tr.BaseTransport)
25
+ assert isinstance(tr.create_transport("sxi", config=config), tr.BaseTransport)
9
26
  assert isinstance(
10
27
  tr.create_transport(
11
28
  "can",
pyxcp/transport/base.py CHANGED
@@ -278,7 +278,7 @@ class BaseTransport(metaclass=abc.ABCMeta):
278
278
  err = types.XcpError.parse(xcpPDU[1:])
279
279
  raise types.XcpResponseError(err)
280
280
  with self.command_lock:
281
- if isinstance(*data, list):
281
+ if isinstance(data, list):
282
282
  data = data[0] # C++ interfacing.
283
283
  frame = self._prepare_request(cmd, *data)
284
284
  with self.policy_lock:
pyxcp/transport/sxi.py CHANGED
@@ -42,7 +42,7 @@ class SxI(BaseTransport):
42
42
  if self.has_user_supplied_interface and transport_layer_interface:
43
43
  self.comm_port = transport_layer_interface
44
44
  else:
45
- self.logger.info(f"XCPonSxI - trying to open serial comm_port {self.port_name}.")
45
+ self.logger.info(f"XCPonSxI - trying to open serial comm_port {self.port_name!r}.")
46
46
  try:
47
47
  self.comm_port = serial.Serial(
48
48
  port=self.port_name,
@@ -88,7 +88,9 @@ class SxI(BaseTransport):
88
88
  self.unpacker = unpacker
89
89
 
90
90
  def connect(self) -> None:
91
- self.logger.info(f"XCPonSxI - serial comm_port openend: {self.comm_port.portstr}@{self.baudrate} Bits/Sec.")
91
+ self.logger.info(
92
+ f"XCPonSxI - serial comm_port {self.comm_port.portstr!r} openend [{self.baudrate}/{self.bytesize}-{self.parity}-{self.stopbits}]"
93
+ )
92
94
  self.start_listener()
93
95
 
94
96
  def output(self, enable) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyxcp
3
- Version: 0.22.30
3
+ Version: 0.22.32
4
4
  Summary: Universal Calibration Protocol for Python
5
5
  Home-page: https://github.com/christoph2/pyxcp
6
6
  License: LGPLv3
@@ -1,4 +1,4 @@
1
- pyxcp/__init__.py,sha256=HOIC2DS0mbadYA1TxxgfWE15jzj_QOTn1CIjlaY82qI,548
1
+ pyxcp/__init__.py,sha256=hwoOIuzcoXDPyoR6x5NWdxjN7nc76IUQbw6JbWX64Pw,548
2
2
  pyxcp/aml/EtasCANMonitoring.a2l,sha256=EJYwe3Z3H24vyWAa6lUgcdKnQY8pwFxjyCN6ZU1ST8w,1509
3
3
  pyxcp/aml/EtasCANMonitoring.aml,sha256=xl0DdyeiIaLW0mmmJNAyJS0CQdOLSxt9dxfgrdSlU8Y,2405
4
4
  pyxcp/aml/ifdata_CAN.a2l,sha256=NCUnCUEEgRbZYSLGtUGwL2e7zJ8hrp0SbmLHGv8uY58,612
@@ -24,19 +24,19 @@ pyxcp/constants.py,sha256=9yGfujC0ImTYQWfn41wyw8pluJTSrhMGWIVeIZTgsLg,1160
24
24
  pyxcp/cpp_ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  pyxcp/cpp_ext/bin.hpp,sha256=PwJloZek21la-RBSda2Hc0u_6gID0sfTduPeplaAyR4,2561
26
26
  pyxcp/cpp_ext/blockmem.hpp,sha256=ysaJwmTWGTfE54Outk3gJYOfAVFd_QaonBMtXLcXwCc,1242
27
- pyxcp/cpp_ext/cpp_ext.cp38-win_amd64.pyd,sha256=PVbL1AA0e19WE-a5MmP2b1WStHXu18QAsHXcT3Qouug,288256
27
+ pyxcp/cpp_ext/cpp_ext.cp38-win_amd64.pyd,sha256=txhdaBwmuLyZdKdXoX4zQaMFpwfyYiIPtnQne5ETWXk,289792
28
28
  pyxcp/cpp_ext/daqlist.hpp,sha256=g2hlxgoQorAGKHedZFZ0c2FQh1APMIA9sVB6M6hD_n8,7277
29
29
  pyxcp/cpp_ext/event.hpp,sha256=Z-1yxsEKsr81NnLVEWJ2ANA8FV7YsM7EbNxaw-elheE,1200
30
- pyxcp/cpp_ext/extension_wrapper.cpp,sha256=FXFjyruBjQYqjCYZZcajdYv6dvNnCggMAbWLqJmfuTM,4756
30
+ pyxcp/cpp_ext/extension_wrapper.cpp,sha256=xFs3IcrvHPHA82-n11WPzt8HATGqcks02p84SjQ2BKM,4855
31
31
  pyxcp/cpp_ext/helper.hpp,sha256=ONAsVupIqqmNDp8bgGWS0TfSYeCFkk3kwwZbbqsh0HQ,7813
32
32
  pyxcp/cpp_ext/mcobject.hpp,sha256=A5GKcfjYMcfm3hfTQfFuS4JYNFTvfmzAcMXCe01GOs4,6429
33
33
  pyxcp/cpp_ext/tsqueue.hpp,sha256=FWMemzXNgV5dQ7gYmTCzC0QYfgl0VI9JCybYelBcCHU,1026
34
- pyxcp/daq_stim/__init__.py,sha256=xQNF6MlVnPHtjj5fKEvXnLWxIJs_Fqd5XVMN4lcFaC8,9532
34
+ pyxcp/daq_stim/__init__.py,sha256=2KsvP9RUV5gwFKTA1BBgsppAegR13ykrqjRtgY0zAx4,9560
35
35
  pyxcp/daq_stim/optimize/__init__.py,sha256=FUWK0GkNpNT-sUlhibp7xa2aSYpm6Flh5yA2w2IOJqg,2520
36
36
  pyxcp/daq_stim/optimize/binpacking.py,sha256=Iltho5diKlJG-ltbmx053U2vOFRlCISolXK61T14l_I,1257
37
37
  pyxcp/daq_stim/scheduler.cpp,sha256=a7VK7kP2Hs8yMlcDAkXwJ0bH88lr_yz156sphcHS7Z4,715
38
38
  pyxcp/daq_stim/scheduler.hpp,sha256=U_6tUbebmzX5vVZS0EFSgTaPsyxMg6yRXHG_aPWA0x4,1884
39
- pyxcp/daq_stim/stim.cp38-win_amd64.pyd,sha256=-jR0z3HkYTs8CJ34kOOHCGpQ1W301cnJ0gteR_0eias,198656
39
+ pyxcp/daq_stim/stim.cp38-win_amd64.pyd,sha256=B9n7Ux6n2IBqUxgw7Qsow-HbCJuA5td1RVTMOzlyq8E,198656
40
40
  pyxcp/daq_stim/stim.cpp,sha256=F2OG67W4KKwTTiUCxm-9egIv3TLFdOkRunX6xf7YOtc,177
41
41
  pyxcp/daq_stim/stim.hpp,sha256=U-uInRrA6OCdMl1l1SWbQ_KEPpnNYrWut924IvbW6R0,18508
42
42
  pyxcp/daq_stim/stim_wrapper.cpp,sha256=iT2yxJ3LRG7HoYC1bwhM3tCAxF9X_HHierBNsLRmTJg,1995
@@ -61,7 +61,7 @@ pyxcp/examples/xcphello.py,sha256=xbcWq8StRJyUZBLUvknsXv7VkEBD5SU0SJjlZTHsSzs,26
61
61
  pyxcp/examples/xcphello_recorder.py,sha256=QHWJsq5h5CI9t5qEmMSorZyzirTpoXz4nzuKTMzbZCA,3409
62
62
  pyxcp/master/__init__.py,sha256=QQbkUJM1WQ-5p2MiNFYxLAmHhNsCQLzDp-S4aoOFxoA,318
63
63
  pyxcp/master/errorhandler.py,sha256=ulL6WiraZbVZnM2pfR8S9vlWAAP5UXwXqmbjjxH9rgc,15359
64
- pyxcp/master/master.py,sha256=rRXw6j198SAhq2xGApaRJD7bn_sTLIepoyOMbT5jRT0,78388
64
+ pyxcp/master/master.py,sha256=LYUrdFXvi01_QW0cR3bb48MbnHQ1WEkV95pKRLBW9Wc,78383
65
65
  pyxcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  pyxcp/recorder/__init__.py,sha256=jeTmKvfjIenxHxt7zn6HMjnDpuPQU0d9SdnYK_t3gdE,2850
67
67
  pyxcp/recorder/build_clang.cmd,sha256=JvFngSnb28XcBGXxC6MGrcOCGYfahOIvHpgRpqbA6HQ,175
@@ -69,7 +69,7 @@ pyxcp/recorder/build_clang.sh,sha256=zmU3nZxaNH1pxGWMyQ-S541TuVqxS00p3iPR9NUP4Ec
69
69
  pyxcp/recorder/build_gcc.cmd,sha256=zj732DdvqDzGAFg7dvF83DUpf8Qf6rQ0cqEaID15Z80,238
70
70
  pyxcp/recorder/build_gcc.sh,sha256=nCSh7G8xtxWtDNrMqNUxcjnm_CFpMeduIF0X-RSJtHA,211
71
71
  pyxcp/recorder/build_gcc_arm.sh,sha256=jEo6Mgt_aVDL3nHtffecXOrN6gRsEoaA3S4pPrAzpCE,240
72
- pyxcp/recorder/converter/__init__.py,sha256=7gP3JmI5aPjVcoVqO7EqwdDKqzzidytH8a8pPKyRvAU,14779
72
+ pyxcp/recorder/converter/__init__.py,sha256=GBaJNTw5lt3030EUZZ7t6CiXs_r2xTqmMUbUgA-2CeM,14898
73
73
  pyxcp/recorder/lz4.c,sha256=rOy3JE2SsOXvJ8a9pgGEfGpbDJnJR03dSVej0CwPmjg,120974
74
74
  pyxcp/recorder/lz4.h,sha256=Kz_2V6kvOunNHoPl9-EqxWDVCvYXbU0J-pkSnCeXubs,46483
75
75
  pyxcp/recorder/lz4hc.c,sha256=E56iE5CQ6fhQIVi3qNpxiIIP2sTGeC80JtVPyhidV6Q,88870
@@ -78,7 +78,7 @@ pyxcp/recorder/mio.hpp,sha256=5ASJLKSEykH0deAQD5uak-_yAgd5p2n8t06315GSGrg,63346
78
78
  pyxcp/recorder/reader.hpp,sha256=rr9XZ_ciL6eF2_xEqyt9XYNqTIze9ytAsnf8uYukO9U,5201
79
79
  pyxcp/recorder/reco.py,sha256=6N6FIwfCEVMpi5dr3eUOQa1lowcg2LCnS_sy_-b-UiQ,8725
80
80
  pyxcp/recorder/recorder.rst,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
- pyxcp/recorder/rekorder.cp38-win_amd64.pyd,sha256=ZLfv27N_FqZFBcqw-dwLcfNfKy1J5wvDgHaxAZOVXWo,386048
81
+ pyxcp/recorder/rekorder.cp38-win_amd64.pyd,sha256=MCVlJIxcYnKDHrBpM-h_FBSXcFTAuvXFdqWVo1iwoyc,386048
82
82
  pyxcp/recorder/rekorder.cpp,sha256=U0LMyk8pZXx9emgS_WPVthvn_9IpgE7JGrh4kg-8CX4,1900
83
83
  pyxcp/recorder/rekorder.hpp,sha256=sWvRch9bVt6mmgrFHp5mwWhap7HoFG4geeb7UqEIzio,7638
84
84
  pyxcp/recorder/setup.py,sha256=_99XFPQAd5V4LcJaSGJwdnbxgxJ7kl8DEXfHsnKO1Yg,998
@@ -100,25 +100,26 @@ pyxcp/tests/test_binpacking.py,sha256=kxLwYNzop775BkV68WXBoXVnLIuP0y4EKIW7u9niMK
100
100
  pyxcp/tests/test_can.py,sha256=fLLATWZxZK3vG-jDwjkWSOCqzy1UmtdV304-3qD6kRQ,63996
101
101
  pyxcp/tests/test_checksum.py,sha256=ZQ9-7bpKBLNKk1jxQ61AKAVUTWReOBYCZ8ikNo2jmII,1808
102
102
  pyxcp/tests/test_daq.py,sha256=aSOYlm75BF6a-Av4-hWSyWKbV8Vzu_Ym2ugiE9UhRP0,5551
103
+ pyxcp/tests/test_daq_opt.py,sha256=GznXj4lVGfLWa8nJ2w3t_IlUQeq8HOspqEHbQq3zJ4I,13011
103
104
  pyxcp/tests/test_frame_padding.py,sha256=b7D0oh_n33iFhi_FKav6LkA0smJB4vg5bTMKu-jIaf0,3205
104
- pyxcp/tests/test_master.py,sha256=guDRWeOObUn52IydA0y3riB8W_6CInnzzeIiu-fjV3E,71422
105
- pyxcp/tests/test_transport.py,sha256=Qn2VjNRfYCU6DH8olVSBUCqb0zdAM9GlTbVBM99YxFQ,1754
105
+ pyxcp/tests/test_master.py,sha256=7bnd4M-F0BaavRuhGo5Jq9MxhGTr6MJBOupZtE82pSc,71440
106
+ pyxcp/tests/test_transport.py,sha256=vv7x7-rHPbmHc7BR8qcXx_Yy8STu1za1OzJmeuUSF14,2487
106
107
  pyxcp/tests/test_utils.py,sha256=SrURAFc_6jtHng3PSZ5gpqXzVBVuPoMPB0YNvOvaIE0,880
107
108
  pyxcp/timing.py,sha256=zE6qPqOuidg6saNt7_zmbQgufxL9Id6akVYhAtpweQc,1705
108
109
  pyxcp/transport/__init__.py,sha256=31PaQLj76n5pXr68aJRWcYfrxEYWWgYoe9f_w3jZxsc,438
109
- pyxcp/transport/base.py,sha256=Wf1ymrchtJ3JaETpVsGEV6X7OQR9o5DZmoD3zoXxkyU,16353
110
+ pyxcp/transport/base.py,sha256=n_tCkebmpq3WXRZncOP5XWgUnSavaBBm3oGZhpeCF9U,16352
110
111
  pyxcp/transport/base_transport.hpp,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
112
  pyxcp/transport/can.py,sha256=pypHU1k5lZODrZpNLsC3IEJ5pPi58OZU_zryd9twr_M,14926
112
113
  pyxcp/transport/eth.py,sha256=xPzN2oSALoPKJVvZpBljPSV1AxfpjRusOzymO-TD1Rw,8711
113
- pyxcp/transport/sxi.py,sha256=vM8WZIKuu_dNuqkxZM_1n6iQkQCCzo4ykWpiG6ba8Fk,4695
114
+ pyxcp/transport/sxi.py,sha256=kWB9x5M1pS7GBtBW6R65KBX7zDI9zcRRZhFM8frmzU0,4760
114
115
  pyxcp/transport/transport_wrapper.cpp,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
116
  pyxcp/transport/usb_transport.py,sha256=JuYrwkWsUdibdVNA57LBEQT3a3ykOgWPdWcfqj96nDE,8343
116
117
  pyxcp/types.py,sha256=mjp3FhsTTbS3D5VuC-dfdbMql0lJwEfbZjf8a2pHi1o,26158
117
118
  pyxcp/utils.py,sha256=gVIhPSvZs-y4o6QB35iJQd0VK_Z9sa3UtCDI3dYQeyo,3457
118
119
  pyxcp/vector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
120
  pyxcp/vector/map.py,sha256=7Gnhvr79geMeqqGVIJPxODXGwABdNDinnqzhpooN5TE,2306
120
- pyxcp-0.22.30.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
121
- pyxcp-0.22.30.dist-info/LICENSE,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
122
- pyxcp-0.22.30.dist-info/METADATA,sha256=9RfnaNaDBT8K-YATbujLnhuEiQ4hMoHiPt0jty4e9PE,4076
123
- pyxcp-0.22.30.dist-info/WHEEL,sha256=NtstD-IOpW_lEkyZJDu2m1YPTvbwMU6Bl4jmuVneh1M,96
124
- pyxcp-0.22.30.dist-info/RECORD,,
121
+ pyxcp-0.22.32.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
122
+ pyxcp-0.22.32.dist-info/LICENSE,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
123
+ pyxcp-0.22.32.dist-info/METADATA,sha256=1JbvEyhRwygPtgWIJqrJAd4DeEtyK8RtdyOLy-JqUzI,4076
124
+ pyxcp-0.22.32.dist-info/WHEEL,sha256=NtstD-IOpW_lEkyZJDu2m1YPTvbwMU6Bl4jmuVneh1M,96
125
+ pyxcp-0.22.32.dist-info/RECORD,,