zlgcan 0.1.15__cp38-cp38-win32.whl → 0.1.16__cp38-cp38-win32.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.
zlgcan/zlgcan.py CHANGED
@@ -11,8 +11,8 @@ from can.bus import LOG
11
11
 
12
12
  from typing import Optional, Union, Sequence, Deque, Tuple, List, Dict
13
13
  try:
14
- from zlgcan_driver_py import ZCanChlCfgPy, ZCanMessagePy, ZDeriveInfoPy, ZCanChlCfgFactoryWrap, ZCanDriverWrap, \
15
- convert_to_python, convert_from_python, set_message_mode, zlgcan_cfg_factory_can, zlgcan_open, \
14
+ from zlgcan_driver import ZCanChlCfgPy, ZCanMessagePy, ZDeriveInfoPy, ZCanDriverWrap, \
15
+ convert_to_python, convert_from_python, set_message_mode, \
16
16
  zlgcan_device_info, zlgcan_init_can, zlgcan_clear_can_buffer, zlgcan_send, zlgcan_recv, zlgcan_close
17
17
  except ModuleNotFoundError:
18
18
  import sys
@@ -20,7 +20,7 @@ except ModuleNotFoundError:
20
20
  _system_bit, _ = platform.architecture()
21
21
  _platform = sys.platform
22
22
  not_support = CanError(f"The system {_platform}'.'{_system_bit} is not supported!")
23
- require_lib = CanError("Please install library `zlgcan-driver-py`!")
23
+ require_lib = CanError("Please install library `zlgcan-driver`!")
24
24
  raise {
25
25
  "win32": {"32bit": not_support}.get(_system_bit, require_lib),
26
26
  "darwin": not_support,
@@ -161,20 +161,12 @@ class ZCanBus(can.BusABC):
161
161
  ) # type: Deque[can.Message] # channel, raw_msg
162
162
  self.channels = []
163
163
 
164
- factory = zlgcan_cfg_factory_can()
165
- self.device = zlgcan_open(device_type, device_index, derive)
166
-
167
- self.dev_info = zlgcan_device_info(self.device)
168
- if self.dev_info is not None:
169
- LOG.info(f"Device: {self.dev_info} has opened")
170
-
171
164
  cfg_list = []
172
165
  for idx, cfg in enumerate(configs):
173
166
  bitrate = cfg.get("bitrate", None)
174
167
  dbitrate = cfg.get("dbitrate", None)
175
168
  assert bitrate is not None, "bitrate is required!"
176
169
  _cfg = ZCanChlCfgPy(
177
- dev_type=device_type,
178
170
  chl_type=cfg.get("chl_type", ZCanChlType.CANFD_ISO if dbitrate else ZCanChlType.CAN),
179
171
  chl_mode=cfg.get("chl_mode", 0),
180
172
  bitrate=bitrate,
@@ -188,7 +180,11 @@ class ZCanBus(can.BusABC):
188
180
  cfg_list.append(_cfg)
189
181
  self.channels.append(idx)
190
182
 
191
- zlgcan_init_can(self.device, factory, cfg_list)
183
+ self.device = zlgcan_init_can(device_type, device_index, cfg_list, derive)
184
+
185
+ self.dev_info = zlgcan_device_info(self.device)
186
+ if self.dev_info is not None:
187
+ LOG.info(f"Device: {self.dev_info} has opened")
192
188
  except Exception as e:
193
189
  self.shutdown()
194
190
  raise e
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zlgcan
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
7
7
  Requires-Dist: python-can
8
8
  License-File: LICENSE.txt
9
9
  Summary: Python wrapper for zlgcan driver.
10
- Author: Smith Jesse
10
+ Author: Jesse Smith
11
11
  License: LGPL v3
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
@@ -0,0 +1,9 @@
1
+ zlgcan-0.1.16.dist-info/METADATA,sha256=YbJ7PRuMYbZiwjg6cn4gdnH67vJrfhyD-mRB1Z4xH7s,4136
2
+ zlgcan-0.1.16.dist-info/WHEEL,sha256=I0oh3Vvc4dQIPlo9T2OQSgeCvmDsIw855l8Cuc55nN8,90
3
+ zlgcan-0.1.16.dist-info/entry_points.txt,sha256=1BprfQnq7A25SfDsPk1ZbOgMv_SmYEUWc7Xz-oAf-V4,45
4
+ zlgcan-0.1.16.dist-info/licenses/LICENSE.txt,sha256=6n0EnHcF3BOvwgLdGOGCfzSE-CEv0_p7gvxKDDY0Msk,7816
5
+ zlgcan/__init__.py,sha256=uspwQytd3RGSaVs6LQADIa9MS_qvzySlfL2S9OhFBQA,21
6
+ zlgcan/zlgcan.py,sha256=Tyo7ITIkJlLdLYwh74zAXe-3QXsKaT27c1NLBVXcgAo,8642
7
+ zlgcan_driver/__init__.py,sha256=JBAj4WkBypBiHIJqXHIJTNHF4kpmhRmKqY48oDAmY3E,135
8
+ zlgcan_driver/zlgcan_driver.cp38-win32.pyd,sha256=VH7Ob_2QsMVL_P41HbzD2VotbMcwK-wt1tfDyjkovf8,638464
9
+ zlgcan-0.1.16.dist-info/RECORD,,
Binary file
@@ -1,9 +0,0 @@
1
- zlgcan-0.1.15.dist-info/METADATA,sha256=ZIaCCDdNIJ0th39KU8BJmaDxoM-DKEzjGXz01pZXWjk,4136
2
- zlgcan-0.1.15.dist-info/WHEEL,sha256=I0oh3Vvc4dQIPlo9T2OQSgeCvmDsIw855l8Cuc55nN8,90
3
- zlgcan-0.1.15.dist-info/entry_points.txt,sha256=1BprfQnq7A25SfDsPk1ZbOgMv_SmYEUWc7Xz-oAf-V4,45
4
- zlgcan-0.1.15.dist-info/licenses/LICENSE.txt,sha256=6n0EnHcF3BOvwgLdGOGCfzSE-CEv0_p7gvxKDDY0Msk,7816
5
- zlgcan/__init__.py,sha256=uspwQytd3RGSaVs6LQADIa9MS_qvzySlfL2S9OhFBQA,21
6
- zlgcan/zlgcan.py,sha256=pxJS2roQ3qny-Te3dzgNjVx-e8kbWO3l3hO_WJtYa-U,8848
7
- zlgcan_driver/__init__.py,sha256=JBAj4WkBypBiHIJqXHIJTNHF4kpmhRmKqY48oDAmY3E,135
8
- zlgcan_driver/zlgcan_driver.cp38-win32.pyd,sha256=jN1gYQaoOLTzfLlkcEn14h4qL16_YTJeNLn5_0VD58E,634880
9
- zlgcan-0.1.15.dist-info/RECORD,,