-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCargo.toml
78 lines (71 loc) · 2.93 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright 2022-2024 Bruce Merry
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
[package]
name = "sunsniff"
version = "0.4.1"
edition = "2021"
authors = ["Bruce Merry"]
license = "GPL-3.0-or-later"
description = "Intercept and store telemetry from a Sunsynk inverter"
repository = "https://github.com/bmerry/sunsniff"
[profile.release]
strip = true
lto = true
[package.metadata.cross.build]
pre-build = [
'set -e',
'apt-get update && apt-get install -y flex bison dpkg-dev',
'cd /tmp',
'curl https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz | tar -zx',
'cd libpcap-1.10.4',
'arch="$(dpkg-architecture -A $CROSS_DEB_ARCH -q DEB_TARGET_GNU_TYPE)"',
'if ! which ${arch}-gcc; then arch="$(./config.sub $arch)"; fi',
'./configure --host "$arch" --disable-shared LDFLAGS="-static"',
'make',
'make install'
]
[features]
default = ["influxdb2", "mqtt", "modbus", "pcap"]
mqtt = ["dep:mqtt-async-client", "dep:serde_json"]
modbus = ["dep:modbus-robust", "dep:serde_with", "dep:tokio-modbus", "dep:tokio-serial", "chrono/clock", "tokio/time"]
pcap = ["dep:chrono-tz", "dep:etherparse", "dep:pcap"]
[build-dependencies]
csv = "1.2.1"
phf_codegen = "0.11.2"
serde = { version = "1.0.159", features = ["derive"] }
[dependencies]
async-std = "1.12.0"
async-trait = "0.1.57"
chrono = { version = "0.4.22", default-features = false, features = ["std"] }
chrono-tz = { version = "0.10.0", features = ["serde"], optional = true }
clap = { version = "4.0.10", features = ["derive"] }
env_logger = "0.11.5"
etherparse = { version = "0.16.0", optional = true }
futures = "0.3.28"
influxdb2 = { version = "0.5.2", default-features = false, features = ["rustls"], optional = true }
log = "0.4.17"
modbus-robust = { version = "0.2.0", optional = true }
mqtt-async-client = { version = "0.3.1", optional = true }
pcap = { version = "2.2.0", features = ["capture-stream"], optional = true }
phf = { version = "0.11.2", default-features = false }
serde = { version = "1.0.159", features = ["derive"] }
serde_json = { version = "1.0.95", optional = true }
serde_with = { version = "3.2.0", optional = true }
tokio = { version = "1.21.2", features = ["macros", "rt"] }
tokio-modbus = { version = "0.16.0", default-features = false, features = ["rtu", "tcp"], optional = true }
tokio-serial = { version = "5.4.4", optional = true }
toml = "0.8.19"
[dev-dependencies]
assert_approx_eq = "1.1.0"