diff --git a/Cargo.lock b/Cargo.lock index 7e042a7..8a7afd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,22 +17,13 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aho-corasick" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" -dependencies = [ - "memchr 2.7.2", -] - [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ - "memchr 2.7.2", + "memchr", ] [[package]] @@ -50,15 +41,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "anstream" version = "0.6.14" @@ -126,7 +108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -137,7 +119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -162,17 +144,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi 0.3.9", -] - [[package]] name = "autocfg" version = "1.3.0" @@ -197,7 +168,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7505fc3cb7acbf42699a43a79dd9caa4ed9e99861dfbb837c5c0fb5a0a8d2980" dependencies = [ - "bindgen 0.69.4", + "bindgen", "cc", "cmake", "dunce", @@ -214,7 +185,7 @@ checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -248,25 +219,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" -[[package]] -name = "bindgen" -version = "0.31.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57253399c086f4f29e57ffd3b5cdbc23a806a00292619351aa4cfa39cb49d4ea" -dependencies = [ - "cexpr 0.2.3", - "cfg-if 0.1.10", - "clang-sys 0.21.2", - "clap 2.34.0", - "env_logger 0.4.3", - "lazy_static 0.2.11", - "log 0.3.9", - "peeking_take_while", - "quote 0.3.15", - "regex 0.2.11", - "which 1.0.5", -] - [[package]] name = "bindgen" version = "0.69.4" @@ -274,20 +226,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ "bitflags 2.5.0", - "cexpr 0.6.0", - "clang-sys 1.7.0", + "cexpr", + "clang-sys", "itertools", - "lazy_static 1.4.0", + "lazy_static", "lazycell", - "log 0.4.21", + "log", "prettyplease", "proc-macro2", - "quote 1.0.36", - "regex 1.10.4", + "quote", + "regex", "rustc-hash", "shlex", "syn 2.0.66", - "which 4.4.2", + "which", ] [[package]] @@ -326,6 +278,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.6.0" @@ -343,30 +301,15 @@ dependencies = [ "once_cell", ] -[[package]] -name = "cexpr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" -dependencies = [ - "nom 3.2.1", -] - [[package]] name = "cexpr" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.3", + "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -388,41 +331,15 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "clang-sys" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e414af9726e1d11660801e73ccc7fb81803fb5f49e5903a25b348b2b3b480d2e" -dependencies = [ - "glob 0.2.11", - "libc", - "libloading 0.4.3", -] - [[package]] name = "clang-sys" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ - "glob 0.3.1", + "glob", "libc", - "libloading 0.8.3", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", + "libloading", ] [[package]] @@ -444,7 +361,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -455,7 +372,7 @@ checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -504,7 +421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" dependencies = [ "percent-encoding", - "time 0.3.36", + "time", "version_check", ] @@ -515,7 +432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "percent-encoding", - "time 0.3.36", + "time", "version_check", ] @@ -527,12 +444,12 @@ checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" dependencies = [ "cookie 0.17.0", "idna 0.3.0", - "log 0.4.21", + "log", "publicsuffix", "serde", "serde_derive", "serde_json", - "time 0.3.36", + "time", "url", ] @@ -603,7 +520,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", - "quote 1.0.36", + "quote", "rustc_version", "syn 1.0.109", ] @@ -625,7 +542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" dependencies = [ "devise_core", - "quote 1.0.36", + "quote", ] [[package]] @@ -637,7 +554,7 @@ dependencies = [ "bitflags 2.5.0", "proc-macro2", "proc-macro2-diagnostics", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -669,17 +586,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "env_logger" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" -dependencies = [ - "log 0.3.9", - "regex 0.2.11", + "cfg-if", ] [[package]] @@ -690,8 +597,8 @@ checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", - "log 0.4.21", - "regex 1.10.4", + "log", + "regex", "termcolor", ] @@ -711,28 +618,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "fastrand" version = "2.1.0" @@ -759,7 +644,7 @@ version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.4.1", "windows-sys 0.52.0", @@ -810,12 +695,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures" version = "0.3.30" @@ -824,6 +703,7 @@ checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -846,12 +726,34 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "futures-sink" version = "0.3.30" @@ -873,9 +775,10 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", - "memchr 2.7.2", + "memchr", "pin-project-lite", "pin-utils", "slab", @@ -889,7 +792,7 @@ checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" dependencies = [ "cc", "libc", - "log 0.4.21", + "log", "rustversion", "windows", ] @@ -910,9 +813,9 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -921,12 +824,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" - [[package]] name = "glob" version = "0.3.1" @@ -989,15 +886,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.9" @@ -1249,7 +1137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", ] [[package]] @@ -1311,7 +1199,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "windows-sys 0.52.0", ] @@ -1361,16 +1249,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "kqueue" version = "1.0.8" @@ -1391,12 +1269,6 @@ dependencies = [ "libc", ] -[[package]] -name = "lazy_static" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1415,53 +1287,16 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "libloading" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" -dependencies = [ - "kernel32-sys", - "lazy_static 1.4.0", - "winapi 0.2.8", -] - [[package]] name = "libloading" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets 0.52.5", ] -[[package]] -name = "libmodbus-rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c93c05970ef216c712383dd33b8dd0c73084a45b640f6931d8d6f0f963f80fdf" -dependencies = [ - "clap 2.34.0", - "failure", - "libc", - "libmodbus-sys", - "rand 0.4.6", - "time 0.1.45", -] - -[[package]] -name = "libmodbus-sys" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d60fb76049179a9bc9625944305ad8e31cb5d703038cb95118b002512caf58a9" -dependencies = [ - "bindgen 0.31.3", - "cc", - "libc", - "pkg-config", -] - [[package]] name = "libudev" version = "0.3.0" @@ -1498,15 +1333,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.21", -] - [[package]] name = "log" version = "0.4.21" @@ -1519,7 +1345,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "generator", "scoped-tls", "serde", @@ -1546,21 +1372,21 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "memchr" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" -dependencies = [ - "libc", -] - [[package]] name = "memchr" version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "miette" version = "7.2.0" @@ -1569,14 +1395,14 @@ checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ "backtrace", "backtrace-ext", - "cfg-if 1.0.0", + "cfg-if", "miette-derive", "owo-colors", "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.16.1", + "textwrap", "thiserror", "unicode-width", ] @@ -1588,7 +1414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -1620,11 +1446,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "log 0.4.21", - "wasi 0.11.0+wasi-snapshot-preview1", + "log", + "wasi", "windows-sys 0.48.0", ] +[[package]] +name = "mio-serial" +version = "5.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20a4c60ca5c9c0e114b3bd66ff4aa5f9b2b175442be51ca6c4365d687a97a2ac" +dependencies = [ + "log", + "mio", + "nix", + "serialport", + "winapi", +] + [[package]] name = "mirai-annotations" version = "1.12.0" @@ -1642,7 +1481,7 @@ dependencies = [ "futures-util", "http 1.1.0", "httparse", - "memchr 2.7.2", + "memchr", "mime", "spin", "tokio", @@ -1656,9 +1495,9 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ - "lazy_static 1.4.0", + "lazy_static", "libc", - "log 0.4.21", + "log", "openssl", "openssl-probe", "openssl-sys", @@ -1675,17 +1514,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", -] - -[[package]] -name = "nom" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" -dependencies = [ - "memchr 1.0.2", + "memoffset", + "pin-utils", ] [[package]] @@ -1694,7 +1526,7 @@ version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "memchr 2.7.2", + "memchr", "minimal-lexical", ] @@ -1711,7 +1543,7 @@ dependencies = [ "inotify", "kqueue", "libc", - "log 0.4.21", + "log", "mio", "walkdir", "windows-sys 0.48.0", @@ -1723,7 +1555,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" dependencies = [ - "log 0.4.21", + "log", "notify", ] @@ -1734,7 +1566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1758,7 +1590,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] @@ -1768,7 +1600,7 @@ version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "memchr 2.7.2", + "memchr", ] [[package]] @@ -1784,7 +1616,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.5.0", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -1799,7 +1631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -1849,7 +1681,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.5.1", "smallvec", @@ -1881,16 +1713,10 @@ checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", - "quote 1.0.36", + "quote", "syn 2.0.66", ] -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -1913,7 +1739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -1936,7 +1762,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e228dbe2aebd82de09c914fe28d36d3170ed5192e8d52b9c070ee0794519c2d3" dependencies = [ "base64 0.21.7", - "rand 0.8.5", + "rand", "sha2", ] @@ -1984,7 +1810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", "version_check", "yansi", @@ -1996,10 +1822,10 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", - "lazy_static 1.4.0", - "memchr 2.7.2", + "lazy_static", + "memchr", "parking_lot", "protobuf", "thiserror", @@ -2027,12 +1853,6 @@ dependencies = [ "psl-types", ] -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" - [[package]] name = "quote" version = "1.0.36" @@ -2042,19 +1862,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi 0.3.9", -] - [[package]] name = "rand" version = "0.8.5" @@ -2063,7 +1870,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -2073,24 +1880,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.6.4" @@ -2100,15 +1892,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2143,31 +1926,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] -[[package]] -name = "regex" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -dependencies = [ - "aho-corasick 0.6.10", - "memchr 2.7.2", - "regex-syntax 0.5.6", - "thread_local 0.3.6", - "utf8-ranges", -] - [[package]] name = "regex" version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ - "aho-corasick 1.1.3", - "memchr 2.7.2", + "aho-corasick", + "memchr", "regex-automata 0.4.6", "regex-syntax 0.8.3", ] @@ -2187,20 +1957,11 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ - "aho-corasick 1.1.3", - "memchr 2.7.2", + "aho-corasick", + "memchr", "regex-syntax 0.8.3", ] -[[package]] -name = "regex-syntax" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -dependencies = [ - "ucd-util", -] - [[package]] name = "regex-syntax" version = "0.6.29" @@ -2236,7 +1997,7 @@ dependencies = [ "hyper-util", "ipnet", "js-sys", - "log 0.4.21", + "log", "mime", "native-tls", "once_cell", @@ -2269,7 +2030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "getrandom", "libc", "spin", @@ -2292,13 +2053,13 @@ dependencies = [ "figment", "futures", "indexmap", - "log 0.4.21", - "memchr 2.7.2", + "log", + "memchr", "multer", "num_cpus", "parking_lot", "pin-project-lite", - "rand 0.8.5", + "rand", "ref-cast", "rocket_codegen", "rocket_http", @@ -2306,7 +2067,7 @@ dependencies = [ "serde_json", "state", "tempfile", - "time 0.3.36", + "time", "tokio", "tokio-stream", "tokio-util", @@ -2322,10 +2083,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" dependencies = [ "devise", - "glob 0.3.1", + "glob", "indexmap", "proc-macro2", - "quote 1.0.36", + "quote", "rocket_http", "syn 2.0.66", "unicode-xid", @@ -2344,8 +2105,8 @@ dependencies = [ "http 0.2.12", "hyper 0.14.28", "indexmap", - "log 0.4.21", - "memchr 2.7.2", + "log", + "memchr", "pear", "percent-encoding", "pin-project-lite", @@ -2354,7 +2115,7 @@ dependencies = [ "smallvec", "stable-pattern", "state", - "time 0.3.36", + "time", "tokio", "uncased", ] @@ -2411,7 +2172,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ - "log 0.4.21", + "log", "ring", "rustls-pki-types", "rustls-webpki", @@ -2426,7 +2187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" dependencies = [ "aws-lc-rs", - "log 0.4.21", + "log", "once_cell", "rustls-pki-types", "rustls-webpki", @@ -2549,7 +2310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -2592,16 +2353,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5a15d0be940df84846264b09b51b10b931fb2f275becb80934e3568a016828" dependencies = [ "bitflags 2.5.0", - "cfg-if 1.0.0", + "cfg-if", "core-foundation-sys", "io-kit-sys", "libudev", "mach2", "nix", - "regex 1.10.4", + "regex", "scopeguard", "unescaper", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2610,7 +2371,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -2621,7 +2382,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "lazy_static 1.4.0", + "lazy_static", ] [[package]] @@ -2682,7 +2443,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" dependencies = [ - "memchr 2.7.2", + "memchr", ] [[package]] @@ -2694,12 +2455,6 @@ dependencies = [ "loom", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.11.1" @@ -2723,7 +2478,7 @@ checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck 0.4.1", "proc-macro2", - "quote 1.0.36", + "quote", "rustversion", "syn 2.0.66", ] @@ -2762,7 +2517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "unicode-ident", ] @@ -2773,7 +2528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "unicode-ident", ] @@ -2783,18 +2538,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -2822,7 +2565,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "rustix", "windows-sys 0.52.0", @@ -2849,19 +2592,18 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "1.4.0" +version = "1.5.0-pre" dependencies = [ "chrono", - "clap 4.5.4", - "env_logger 0.10.2", + "clap", + "env_logger", "if_chain", "include_dir", - "lazy_static 1.4.0", - "libmodbus-rs", - "log 0.4.21", + "lazy_static", + "log", "notify-debouncer-mini", "prometheus", - "rand 0.8.5", + "rand", "reqwest", "rocket", "ron", @@ -2872,6 +2614,8 @@ dependencies = [ "teslatte", "thiserror", "tokio", + "tokio-modbus", + "tokio-serial", ] [[package]] @@ -2891,12 +2635,12 @@ version = "0.1.15" source = "git+https://git.alexjanka.com/alex/teslatte#490a50e24ca875e5eb26efc40c12229d5d2e1659" dependencies = [ "chrono", - "clap 4.5.4", + "clap", "colored_json", "derive_more", "miette", "pkce", - "rand 0.8.5", + "rand", "reqwest", "rustls 0.23.8", "serde", @@ -2910,15 +2654,6 @@ dependencies = [ "urlencoding", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.16.1" @@ -2946,40 +2681,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] -[[package]] -name = "thread_local" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -dependencies = [ - "lazy_static 1.4.0", -] - [[package]] name = "thread_local" version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", -] - [[package]] name = "time" version = "0.3.36" @@ -3052,10 +2767,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] +[[package]] +name = "tokio-modbus" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fafa6b1efdb58d1dd98ec331448dc64c713bb3a6808baae9b35188af304e4f" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "futures-core", + "futures-util", + "log", + "smallvec", + "thiserror", + "tokio", + "tokio-util", +] + [[package]] name = "tokio-native-tls" version = "0.3.1" @@ -3077,6 +2810,19 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-serial" +version = "5.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa6e2e4cf0520a99c5f87d5abb24172b5bd220de57c3181baaaa5440540c64aa" +dependencies = [ + "cfg-if", + "futures", + "log", + "mio-serial", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.15" @@ -3169,7 +2915,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log 0.4.21", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3182,7 +2928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] @@ -3202,7 +2948,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "log 0.4.21", + "log", "once_cell", "tracing-core", ] @@ -3216,10 +2962,10 @@ dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex 1.10.4", + "regex", "sharded-slab", "smallvec", - "thread_local 1.1.8", + "thread_local", "tracing", "tracing-core", "tracing-log", @@ -3246,12 +2992,6 @@ dependencies = [ "serde", ] -[[package]] -name = "ucd-util" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd2fc5d32b590614af8b0a20d837f32eca055edd0bbead59a9cfe80858be003" - [[package]] name = "uncased" version = "0.9.10" @@ -3333,12 +3073,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf8-ranges" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" - [[package]] name = "utf8parse" version = "0.2.1" @@ -3357,12 +3091,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -3388,12 +3116,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3406,7 +3128,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -3417,10 +3139,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "log 0.4.21", + "log", "once_cell", "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", "wasm-bindgen-shared", ] @@ -3431,7 +3153,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -3443,7 +3165,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ - "quote 1.0.36", + "quote", "wasm-bindgen-macro-support", ] @@ -3454,7 +3176,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -3485,15 +3207,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" -dependencies = [ - "libc", -] - [[package]] name = "which" version = "4.4.2" @@ -3506,12 +3219,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -3522,12 +3229,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -3712,7 +3413,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ - "memchr 2.7.2", + "memchr", ] [[package]] @@ -3721,7 +3422,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -3750,6 +3451,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", - "quote 1.0.36", + "quote", "syn 2.0.66", ] diff --git a/Cargo.toml b/Cargo.toml index 88dfeb1..e489005 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tesla-charge-controller" -version = "1.4.0" +version = "1.5.0-pre" edition = "2021" license = "MITNFA" description = "Controls Tesla charge rate based on solar charge data" @@ -28,7 +28,8 @@ prometheus = "0.13" env_logger = "0.10" log = "0.4" serialport = "4.3" -libmodbus-rs = "0.8.3" +tokio-modbus = "0.13.1" +tokio-serial = "5.4.4" if_chain = "1.0.2" notify-debouncer-mini = { version = "0.4.1", default-features = false } lazy_static = "1.4" diff --git a/src/api_interface.rs b/src/api_interface.rs index dea18b8..d44de79 100644 --- a/src/api_interface.rs +++ b/src/api_interface.rs @@ -470,7 +470,9 @@ impl TeslaInterface { .map(|v| { if self.monitored_values.conn_charge_cable != v.conn_charge_cable { log::warn!("Current conn charge cable: \"{}\"", v.conn_charge_cable); - self.monitored_values.conn_charge_cable = v.conn_charge_cable.clone(); + self.monitored_values + .conn_charge_cable + .clone_from(&v.conn_charge_cable); } v.into() }); @@ -507,7 +509,9 @@ impl TeslaInterface { .and_then(|v| { if self.monitored_values.climate_keeper != v.climate_keeper_mode { log::warn!("Current climate keeper mode: \"{}\"", v.climate_keeper_mode); - self.monitored_values.climate_keeper = v.climate_keeper_mode.clone(); + self.monitored_values + .climate_keeper + .clone_from(&v.climate_keeper_mode); } v.try_into().ok() }); diff --git a/src/charge_controllers/tristar.rs b/src/charge_controllers/tristar.rs index f903de1..24f0776 100644 --- a/src/charge_controllers/tristar.rs +++ b/src/charge_controllers/tristar.rs @@ -1,5 +1,5 @@ -use libmodbus_rs::{Modbus, ModbusClient, ModbusRTU}; use prometheus::core::{AtomicI64, GenericGauge}; +use tokio_modbus::client::Reader; use crate::{ charge_controllers::gauges::*, @@ -44,7 +44,7 @@ impl Scaling { pub struct Tristar { state: TristarState, port_name: String, - modbus: Modbus, + modbus: tokio_modbus::client::Context, data_in: [u16; RAM_ARRAY_SIZE], charge_state_gauges: ChargeStateGauges, consecutive_errors: usize, @@ -233,16 +233,12 @@ impl ChargeStateGauges { } } -const MAX_CONSECUTIVE_ERRORS: usize = 5; - impl Tristar { - pub fn new(serial_port: String, baud_rate: i32) -> Result { - let parity = 'N'; - let data_bit = 8; - let stop_bit = 2; - let mut modbus = Modbus::new_rtu(&serial_port, baud_rate, parity, data_bit, stop_bit)?; - modbus.set_slave(DEVICE_ID)?; - modbus.connect()?; + pub fn new(serial_port: String, baud_rate: u32) -> Result { + let modbus_serial = + tokio_serial::SerialStream::open(&tokio_serial::new(&serial_port, baud_rate))?; + let slave = tokio_modbus::Slave(DEVICE_ID); + let modbus = tokio_modbus::client::rtu::attach_slave(modbus_serial, slave); let charge_state_gauges = ChargeStateGauges::new(&serial_port); Ok(Self { state: Default::default(), @@ -254,9 +250,10 @@ impl Tristar { }) } - pub fn refresh(&mut self) { + pub async fn refresh(&mut self) { if let Some(new_state) = self .get_data() + .await .some_or_print_with("reading tristar state") .map(|scaling| TristarState::from_ram(scaling, &self.data_in)) { @@ -297,21 +294,24 @@ impl Tristar { self.charge_state_gauges.set(new_state.charge_state); self.state = new_state; - } else { - self.consecutive_errors += 1; - if self.consecutive_errors >= MAX_CONSECUTIVE_ERRORS { - self.modbus.close(); - if let Err(e) = self.modbus.connect() { - log::error!("error reconnecting to modbus device: {e:?}"); - } - } } + // else { + // self.consecutive_errors += 1; + // if self.consecutive_errors >= MAX_CONSECUTIVE_ERRORS { + // self.modbus.close(); + // if let Err(e) = self.modbus.connect() { + // log::error!("error reconnecting to modbus device: {e:?}"); + // } + // } + // } } - fn get_data(&mut self) -> Result { - self.modbus - .read_registers(0x0000, RAM_DATA_SIZE + 1, &mut self.data_in)?; - let scaling = Scaling::from(&self.data_in); + async fn get_data(&mut self) -> Result { + let data = self + .modbus + .read_holding_registers(0x0000, RAM_DATA_SIZE + 1) + .await??; + let scaling = Scaling::from(&data); Ok(scaling) } } diff --git a/src/config.rs b/src/config.rs index 77d8805..61d924c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -157,7 +157,7 @@ pub enum ChargeControllerConfig { }, Tristar { serial_port: String, - baud_rate: i32, + baud_rate: u32, watch_interval_seconds: u64, }, } diff --git a/src/errors.rs b/src/errors.rs index 3f4276b..db4adeb 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -104,14 +104,12 @@ pub enum TeslaStateParseError { #[derive(Error, Debug)] pub enum TristarError { - #[error("modbus error")] - Modbus(libmodbus_rs::prelude::Error), -} - -impl From for TristarError { - fn from(value: libmodbus_rs::prelude::Error) -> Self { - Self::Modbus(value) - } + #[error(transparent)] + Modbus(#[from] tokio_modbus::Error), + #[error(transparent)] + ModbusException(#[from] tokio_modbus::Exception), + #[error(transparent)] + Serial(#[from] tokio_serial::Error), } #[derive(Error, Debug)] diff --git a/src/main.rs b/src/main.rs index a1a18d5..8d8b81e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,8 +72,7 @@ async fn main() { let (api_requests, mut api_receiver) = tokio::sync::mpsc::unbounded_channel(); // and to the pli thread let (pli_requests, mut pli_receiver) = tokio::sync::mpsc::unbounded_channel(); - // and to the charge rate controller thread - let (tcrc_requests, mut tcrc_receiver) = tokio::sync::mpsc::unbounded_channel(); + // try to spawn the pli loop let pli = { let config = access_config(); @@ -146,7 +145,7 @@ async fn main() { ); loop { interval.tick().await; - tristar.refresh(); + tristar.refresh().await; } }) }), @@ -173,7 +172,7 @@ async fn main() { pl_state, api_requests, pli_requests, - tcrc_requests, + // tcrc_requests, )); if let Some((mut interface, mut tesla_charge_rate_controller)) = interface_and_tcrc { @@ -222,10 +221,6 @@ async fn main() { api_message = api_receiver.recv() => match api_message { Some(message) => interface.process_request(message).await, None => panic!("Tesla send channel dropped") - }, - tcrc_message = tcrc_receiver.recv() => match tcrc_message { - Some(message) => tesla_charge_rate_controller.process_request(message), - None => panic!("TCRC send channel dropped") } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index 5acdd76..10b4fb2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -16,7 +16,7 @@ use crate::{ charge_controllers::pl::{PlState, PliRequest, RegulatorState}, config::{access_config, write_to_config}, errors::{PrintErrors, ServerError}, - tesla_charge_rate::{TcrcRequest, TcrcState}, + tesla_charge_rate::TcrcState, types::CarState, }; @@ -30,7 +30,6 @@ pub struct ServerState { pub pl_state: Option>>, pub api_requests: UnboundedSender, pub pli_requests: UnboundedSender, - pub tcrc_requests: UnboundedSender, waiting_for_auth: std::sync::Mutex>, } @@ -41,7 +40,6 @@ impl ServerState { pl_state: Option>>, api_requests: UnboundedSender, pli_requests: UnboundedSender, - tcrc_requests: UnboundedSender, ) -> Self { Self { car_state, @@ -49,7 +47,7 @@ impl ServerState { pl_state, api_requests, pli_requests, - tcrc_requests, + // tcrc_requests, waiting_for_auth: std::sync::Mutex::new(None), } }