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.
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/.github/workflows/CI.yml +0 -2
- zlgcan-0.2.1b0/CHANGELOG.md +12 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/Cargo.lock +43 -44
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/Cargo.toml +4 -4
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/PKG-INFO +2 -3
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/README.md +1 -2
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/src/lib.rs +4 -4
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/src/wrappers/mod.rs +6 -6
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/.editorconfig +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/.github/workflows/label-check.yml +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/.gitignore +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/LICENSE.txt +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/pyproject.toml +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/requirements.txt +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/src/wrappers/constants.rs +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/zlgcan/__init__.py +0 -0
- {zlgcan-0.2.0 → zlgcan-0.2.1b0}/zlgcan/zlgcan.py +0 -0
@@ -4,27 +4,21 @@ version = 4
|
|
4
4
|
|
5
5
|
[[package]]
|
6
6
|
name = "anyhow"
|
7
|
-
version = "1.0.
|
7
|
+
version = "1.0.98"
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
-
checksum = "
|
9
|
+
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
10
10
|
|
11
11
|
[[package]]
|
12
12
|
name = "autocfg"
|
13
|
-
version = "1.
|
13
|
+
version = "1.5.0"
|
14
14
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
15
|
-
checksum = "
|
15
|
+
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
16
16
|
|
17
17
|
[[package]]
|
18
18
|
name = "bitflags"
|
19
|
-
version = "2.9.
|
19
|
+
version = "2.9.1"
|
20
20
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
21
|
-
checksum = "
|
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.
|
36
|
+
version = "0.8.0"
|
43
37
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
44
|
-
checksum = "
|
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.
|
48
|
+
version = "0.4.1"
|
55
49
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
56
|
-
checksum = "
|
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.
|
65
|
+
version = "0.15.4"
|
72
66
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
73
|
-
checksum = "
|
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.
|
99
|
+
version = "0.2.174"
|
106
100
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
107
|
-
checksum = "
|
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.
|
126
|
+
version = "1.11.1"
|
133
127
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
134
|
-
checksum = "
|
128
|
+
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
135
129
|
|
136
130
|
[[package]]
|
137
131
|
name = "proc-macro2"
|
138
|
-
version = "1.0.
|
132
|
+
version = "1.0.95"
|
139
133
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
140
|
-
checksum = "
|
134
|
+
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
141
135
|
dependencies = [
|
142
136
|
"unicode-ident",
|
143
137
|
]
|
144
138
|
|
145
139
|
[[package]]
|
146
140
|
name = "pyo3"
|
147
|
-
version = "0.
|
141
|
+
version = "0.25.1"
|
148
142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
149
|
-
checksum = "
|
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.
|
158
|
+
version = "0.25.1"
|
166
159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
167
|
-
checksum = "
|
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.
|
168
|
+
version = "0.25.1"
|
176
169
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
177
|
-
checksum = "
|
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.
|
178
|
+
version = "0.25.1"
|
186
179
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
187
|
-
checksum = "
|
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.
|
190
|
+
version = "0.25.1"
|
198
191
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
199
|
-
checksum = "
|
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.
|
220
|
-
source = "
|
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.
|
270
|
+
version = "2.0.104"
|
272
271
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
273
|
-
checksum = "
|
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.
|
349
|
-
source = "
|
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.
|
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.
|
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.
|
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 = "
|
17
|
-
zlgcan = "
|
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.
|
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
|

|
18
18
|

|
19
19
|
|
20
|
-
# ZLGCAN驱动及集成到python-can(
|
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
|

|
2
2
|

|
3
3
|
|
4
|
-
# ZLGCAN驱动及集成到python-can(
|
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
|
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
|
49
|
+
builder.add_config(i as u8, c);
|
50
50
|
}
|
51
51
|
|
52
|
-
let device
|
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
|
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
|
8
|
-
can::CanMessage,
|
7
|
+
use zlgcan::{
|
8
|
+
can::{CanMessage, ZCanTxMode},
|
9
9
|
device::DeriveInfo,
|
10
|
-
driver::
|
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
|
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<
|
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
|
File without changes
|
File without changes
|