zlgcan 0.2.0__tar.gz → 0.2.1b0__tar.gz

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.
@@ -48,8 +48,6 @@ jobs:
48
48
  platform:
49
49
  - runner: windows-latest
50
50
  target: x64
51
- - runner: windows-latest
52
- target: x86
53
51
  steps:
54
52
  - uses: actions/checkout@v4
55
53
  - uses: actions/setup-python@v5
@@ -0,0 +1,12 @@
1
+ Version 0.2.1
2
+ =============
3
+
4
+ Features
5
+ --------
6
+
7
+ * 更改库文件配置方式
8
+
9
+ Bug Fixes
10
+ ---------
11
+
12
+ * 修复v0.2.0 Windows下不能接收CAN报文的Bug
@@ -4,27 +4,21 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "anyhow"
7
- version = "1.0.97"
7
+ version = "1.0.98"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
9
+ checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
10
10
 
11
11
  [[package]]
12
12
  name = "autocfg"
13
- version = "1.4.0"
13
+ version = "1.5.0"
14
14
  source = "registry+https://github.com/rust-lang/crates.io-index"
15
- checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
15
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
16
16
 
17
17
  [[package]]
18
18
  name = "bitflags"
19
- version = "2.9.0"
19
+ version = "2.9.1"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
22
-
23
- [[package]]
24
- name = "cfg-if"
25
- version = "1.0.0"
26
- source = "registry+https://github.com/rust-lang/crates.io-index"
27
- checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
21
+ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
28
22
 
29
23
  [[package]]
30
24
  name = "derive-getters"
@@ -39,9 +33,9 @@ dependencies = [
39
33
 
40
34
  [[package]]
41
35
  name = "dlopen2"
42
- version = "0.7.0"
36
+ version = "0.8.0"
43
37
  source = "registry+https://github.com/rust-lang/crates.io-index"
44
- checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6"
38
+ checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff"
45
39
  dependencies = [
46
40
  "dlopen2_derive",
47
41
  "libc",
@@ -51,9 +45,9 @@ dependencies = [
51
45
 
52
46
  [[package]]
53
47
  name = "dlopen2_derive"
54
- version = "0.4.0"
48
+ version = "0.4.1"
55
49
  source = "registry+https://github.com/rust-lang/crates.io-index"
56
- checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
50
+ checksum = "788160fb30de9cdd857af31c6a2675904b16ece8fc2737b2c7127ba368c9d0f4"
57
51
  dependencies = [
58
52
  "proc-macro2",
59
53
  "quote",
@@ -68,9 +62,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
68
62
 
69
63
  [[package]]
70
64
  name = "hashbrown"
71
- version = "0.15.2"
65
+ version = "0.15.4"
72
66
  source = "registry+https://github.com/rust-lang/crates.io-index"
73
- checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
67
+ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
74
68
 
75
69
  [[package]]
76
70
  name = "heck"
@@ -102,9 +96,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
102
96
 
103
97
  [[package]]
104
98
  name = "libc"
105
- version = "0.2.171"
99
+ version = "0.2.174"
106
100
  source = "registry+https://github.com/rust-lang/crates.io-index"
107
- checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
101
+ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
108
102
 
109
103
  [[package]]
110
104
  name = "log"
@@ -129,26 +123,25 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
129
123
 
130
124
  [[package]]
131
125
  name = "portable-atomic"
132
- version = "1.11.0"
126
+ version = "1.11.1"
133
127
  source = "registry+https://github.com/rust-lang/crates.io-index"
134
- checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
128
+ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
135
129
 
136
130
  [[package]]
137
131
  name = "proc-macro2"
138
- version = "1.0.94"
132
+ version = "1.0.95"
139
133
  source = "registry+https://github.com/rust-lang/crates.io-index"
140
- checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
134
+ checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
141
135
  dependencies = [
142
136
  "unicode-ident",
143
137
  ]
144
138
 
145
139
  [[package]]
146
140
  name = "pyo3"
147
- version = "0.24.1"
141
+ version = "0.25.1"
148
142
  source = "registry+https://github.com/rust-lang/crates.io-index"
149
- checksum = "17da310086b068fbdcefbba30aeb3721d5bb9af8db4987d6735b2183ca567229"
143
+ checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
150
144
  dependencies = [
151
- "cfg-if",
152
145
  "indoc",
153
146
  "libc",
154
147
  "memoffset",
@@ -162,9 +155,9 @@ dependencies = [
162
155
 
163
156
  [[package]]
164
157
  name = "pyo3-build-config"
165
- version = "0.24.1"
158
+ version = "0.25.1"
166
159
  source = "registry+https://github.com/rust-lang/crates.io-index"
167
- checksum = "e27165889bd793000a098bb966adc4300c312497ea25cf7a690a9f0ac5aa5fc1"
160
+ checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
168
161
  dependencies = [
169
162
  "once_cell",
170
163
  "target-lexicon",
@@ -172,9 +165,9 @@ dependencies = [
172
165
 
173
166
  [[package]]
174
167
  name = "pyo3-ffi"
175
- version = "0.24.1"
168
+ version = "0.25.1"
176
169
  source = "registry+https://github.com/rust-lang/crates.io-index"
177
- checksum = "05280526e1dbf6b420062f3ef228b78c0c54ba94e157f5cb724a609d0f2faabc"
170
+ checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
178
171
  dependencies = [
179
172
  "libc",
180
173
  "pyo3-build-config",
@@ -182,9 +175,9 @@ dependencies = [
182
175
 
183
176
  [[package]]
184
177
  name = "pyo3-macros"
185
- version = "0.24.1"
178
+ version = "0.25.1"
186
179
  source = "registry+https://github.com/rust-lang/crates.io-index"
187
- checksum = "5c3ce5686aa4d3f63359a5100c62a127c9f15e8398e5fdeb5deef1fed5cd5f44"
180
+ checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
188
181
  dependencies = [
189
182
  "proc-macro2",
190
183
  "pyo3-macros-backend",
@@ -194,9 +187,9 @@ dependencies = [
194
187
 
195
188
  [[package]]
196
189
  name = "pyo3-macros-backend"
197
- version = "0.24.1"
190
+ version = "0.25.1"
198
191
  source = "registry+https://github.com/rust-lang/crates.io-index"
199
- checksum = "f4cf6faa0cbfb0ed08e89beb8103ae9724eb4750e3a78084ba4017cbe94f3855"
192
+ checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
200
193
  dependencies = [
201
194
  "heck",
202
195
  "proc-macro2",
@@ -216,17 +209,23 @@ dependencies = [
216
209
 
217
210
  [[package]]
218
211
  name = "rs-can"
219
- version = "0.2.2"
220
- source = "registry+https://github.com/rust-lang/crates.io-index"
221
- checksum = "7deea04551200cab94e5f3faf27be4ad02f84138db280630aa8f3b0b6bcb29ed"
212
+ version = "0.3.0"
213
+ source = "git+https://github.com/jesses2025smith/rust-can.git?rev=e76db38dd2e6d66f0afa9374e9a9513d984b6be2#e76db38dd2e6d66f0afa9374e9a9513d984b6be2"
222
214
  dependencies = [
223
215
  "bitflags",
224
216
  "derive-getters",
225
217
  "log",
218
+ "rsutil",
226
219
  "serde",
227
220
  "thiserror",
228
221
  ]
229
222
 
223
+ [[package]]
224
+ name = "rsutil"
225
+ version = "0.1.12"
226
+ source = "registry+https://github.com/rust-lang/crates.io-index"
227
+ checksum = "2db82abc50469bbff9ce708b13b3ff27c779a8ddbbe5640017278608bf33b820"
228
+
230
229
  [[package]]
231
230
  name = "ryu"
232
231
  version = "1.0.20"
@@ -268,9 +267,9 @@ dependencies = [
268
267
 
269
268
  [[package]]
270
269
  name = "syn"
271
- version = "2.0.100"
270
+ version = "2.0.104"
272
271
  source = "registry+https://github.com/rust-lang/crates.io-index"
273
- checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
272
+ checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
274
273
  dependencies = [
275
274
  "proc-macro2",
276
275
  "quote",
@@ -345,20 +344,20 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
345
344
 
346
345
  [[package]]
347
346
  name = "zlgcan"
348
- version = "0.2.2"
349
- source = "registry+https://github.com/rust-lang/crates.io-index"
350
- checksum = "2c4aa30b676bf4cb84f707cba8a8336585d8028bdcf4daaf87ca30bfaf233589"
347
+ version = "0.3.0"
348
+ source = "git+https://github.com/jesses2025smith/rust-can.git?rev=e76db38dd2e6d66f0afa9374e9a9513d984b6be2#e76db38dd2e6d66f0afa9374e9a9513d984b6be2"
351
349
  dependencies = [
352
350
  "dlopen2",
353
351
  "log",
354
352
  "rs-can",
353
+ "rsutil",
355
354
  "serde",
356
355
  "serde_yaml",
357
356
  ]
358
357
 
359
358
  [[package]]
360
359
  name = "zlgcan-driver"
361
- version = "0.2.0"
360
+ version = "0.2.1-beta"
362
361
  dependencies = [
363
362
  "anyhow",
364
363
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "zlgcan-driver"
3
- version = "0.2.0"
3
+ version = "0.2.1-beta"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -9,12 +9,12 @@ name = "zlgcan_driver"
9
9
  crate-type = ["cdylib"]
10
10
 
11
11
  [dependencies]
12
- pyo3 = "0.24"
12
+ pyo3 = "0.25"
13
13
  #iso15765-2 = { version = "0.1.0-alpha0" }
14
14
  #iso14229-1 = { version = "0.1.0-alpha0" }
15
15
  #docan = { version = "0.1.0-alpha0" }
16
- rs-can = "0.2.2"
17
- zlgcan = "0.2.2"
16
+ rs-can = { git = "https://github.com/jesses2025smith/rust-can.git", package = "rs-can", rev = "e76db38dd2e6d66f0afa9374e9a9513d984b6be2" }
17
+ zlgcan = { git = "https://github.com/jesses2025smith/rust-can.git", package = "zlgcan", rev = "e76db38dd2e6d66f0afa9374e9a9513d984b6be2" }
18
18
 
19
19
  [dev-dependencies]
20
20
  anyhow = "1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zlgcan
3
- Version: 0.2.0
3
+ Version: 0.2.1b0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -17,7 +17,7 @@ Project-URL: repository, https://github.com/zhuyu4839/zlgcan-driver
17
17
  ![PyPI Downloads](https://static.pepy.tech/badge/zlgcan)
18
18
  ![PyPI Downloads](https://static.pepy.tech/badge/zlgcan/month)
19
19
 
20
- # ZLGCAN驱动及集成到python-can(因内存模型不同,目前Windows下32位python会报内存非法访问的错误)
20
+ # ZLGCAN驱动及集成到python-can(不支持32位)
21
21
 
22
22
  1. 准备
23
23
  * 确保安装相关驱动(USBCAN-I/II驱动得额外安装)
@@ -30,7 +30,6 @@ Project-URL: repository, https://github.com/zhuyu4839/zlgcan-driver
30
30
  ├──linux
31
31
  │ └─x86_64
32
32
  └─windows
33
- ├─x86
34
33
  └─x86_64
35
34
  ```
36
35
  * 在初始化can.Bus的时候指定zlgcan库路径(从0.2.0开始移除`zcan.env`配置), 默认为相对工程运行文件同级目录下`library`
@@ -1,7 +1,7 @@
1
1
  ![PyPI Downloads](https://static.pepy.tech/badge/zlgcan)
2
2
  ![PyPI Downloads](https://static.pepy.tech/badge/zlgcan/month)
3
3
 
4
- # ZLGCAN驱动及集成到python-can(因内存模型不同,目前Windows下32位python会报内存非法访问的错误)
4
+ # ZLGCAN驱动及集成到python-can(不支持32位)
5
5
 
6
6
  1. 准备
7
7
  * 确保安装相关驱动(USBCAN-I/II驱动得额外安装)
@@ -14,7 +14,6 @@
14
14
  ├──linux
15
15
  │ └─x86_64
16
16
  └─windows
17
- ├─x86
18
17
  └─x86_64
19
18
  ```
20
19
  * 在初始化can.Bus的时候指定zlgcan库路径(从0.2.0开始移除`zcan.env`配置), 默认为相对工程运行文件同级目录下`library`
@@ -3,7 +3,7 @@ pub(crate) mod wrappers;
3
3
  use std::sync::{Arc, Mutex};
4
4
  use pyo3::{exceptions, prelude::*};
5
5
  use rs_can::{CanError, CanFrame, CanType, ChannelConfig, DeviceBuilder};
6
- use zlgcan_rs::{can::{CanMessage, ZCanFrameType}, device::DeriveInfo, driver::{ZCanDriver, ZDevice}, ACC_CODE, ACC_MASK, BRP, CHANNEL_MODE, CHANNEL_TYPE, DERIVE_INFO, DEVICE_INDEX, DEVICE_TYPE, FILTER_TYPE, LIBPATH};
6
+ use zlgcan::{*, can::*, device::*, driver::*};
7
7
  use crate::wrappers::{ZCanChlCfgPy, ZCanDriverWrap, ZCanMessagePy, ZDeriveInfoPy};
8
8
 
9
9
  #[pyfunction]
@@ -46,10 +46,10 @@ fn zlgcan_init_can(
46
46
  cfg.acc_mask.map(|acc_mask| c.add_other(ACC_MASK, Box::new(acc_mask)));
47
47
  cfg.brp.map(|brp| c.add_other(BRP, Box::new(brp)));
48
48
 
49
- builder.add_config(i.to_string(), c);
49
+ builder.add_config(i as u8, c);
50
50
  }
51
51
 
52
- let device: ZCanDriver = builder.build()
52
+ let device = builder.build::<ZDriver>()
53
53
  .map_err(|e| exceptions::PyValueError::new_err(e.to_string()))?;
54
54
 
55
55
  Ok(ZCanDriverWrap { inner: Arc::new(Mutex::new(device)) })
@@ -166,7 +166,7 @@ fn zlgcan_driver(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
166
166
  #[cfg(test)]
167
167
  mod tests {
168
168
  use std::time::Instant;
169
- use zlgcan_rs::{
169
+ use zlgcan::{
170
170
  can::{ZCanChlMode, ZCanChlType},
171
171
  device::ZCanDeviceType,
172
172
  };
@@ -4,10 +4,10 @@ use constants::*;
4
4
  use std::sync::{Arc, Mutex};
5
5
  use pyo3::{exceptions, prelude::*, types::PyDict};
6
6
  use rs_can::{CanDirect, CanFrame, CanId, CanType};
7
- use zlgcan_rs::{
8
- can::CanMessage,
7
+ use zlgcan::{
8
+ can::{CanMessage, ZCanTxMode},
9
9
  device::DeriveInfo,
10
- driver::ZCanDriver
10
+ driver::ZDriver
11
11
  };
12
12
 
13
13
  #[pyclass]
@@ -27,14 +27,14 @@ impl ZDeriveInfoPy {
27
27
 
28
28
  impl Into<DeriveInfo> for ZDeriveInfoPy {
29
29
  fn into(self) -> DeriveInfo {
30
- DeriveInfo::new(self.canfd, self.channels)
30
+ DeriveInfo { canfd: self.canfd, channels: self.channels }
31
31
  }
32
32
  }
33
33
 
34
34
  #[pyclass]
35
35
  #[derive(Clone)]
36
36
  pub struct ZCanDriverWrap {
37
- pub(crate) inner: Arc<Mutex<ZCanDriver>>,
37
+ pub(crate) inner: Arc<Mutex<ZDriver>>,
38
38
  }
39
39
 
40
40
  #[pyclass]
@@ -135,7 +135,7 @@ impl TryInto<CanMessage> for ZCanMessagePy {
135
135
  msg.set_timestamp(None)
136
136
  .set_direct(if self.is_rx { CanDirect::Receive } else { CanDirect::Transmit })
137
137
  .set_channel(self.channel)
138
- .set_tx_mode(self.tx_mode)
138
+ .set_tx_mode(ZCanTxMode::try_from(self.tx_mode).map_err(|e| exceptions::PyValueError::new_err(e.to_string()))?)
139
139
  .set_can_type(if self.is_fd { CanType::CanFd } else { CanType::Can })
140
140
  .set_bitrate_switch(self.bitrate_switch)
141
141
  .set_esi(self.error_state_indicator)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes