diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..0d9bc80 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,14 @@ +[target.riscv32imac-unknown-none-elf] +runner = "espflash flash --monitor --chip esp32c6" + +[build] +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + +target = "riscv32imac-unknown-none-elf" + +[unstable] +build-std = ["alloc", "core"] diff --git a/3d_print/Deckel.3mf b/3d_print/Deckel.3mf deleted file mode 100644 index 0667e24..0000000 Binary files a/3d_print/Deckel.3mf and /dev/null differ diff --git a/3d_print/Gehause.3mf b/3d_print/Gehause.3mf deleted file mode 100644 index 2a22019..0000000 Binary files a/3d_print/Gehause.3mf and /dev/null differ diff --git a/3d_print/LWL.3mf b/3d_print/LWL.3mf deleted file mode 100644 index 3d43c25..0000000 Binary files a/3d_print/LWL.3mf and /dev/null differ diff --git a/3d_print/Proxmark_halter.3mf b/3d_print/Proxmark_halter.3mf deleted file mode 100644 index 3f9b512..0000000 Binary files a/3d_print/Proxmark_halter.3mf and /dev/null differ diff --git a/Cargo.lock b/Cargo.lock index 73ff820..49916c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,43 +3,10 @@ version = 4 [[package]] -name = "addr2line" -version = "0.24.2" +name = "allocator-api2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] +checksum = "78200ac3468a57d333cd0ea5dd398e25111194dcacd49208afca95c629a6311d" [[package]] name = "anyhow" @@ -47,169 +14,134 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "async-trait" -version = "0.1.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - -[[package]] -name = "atomic" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" -dependencies = [ - "bytemuck", -] - [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] -name = "backtrace" -version = "0.3.74" +name = "basic-toml" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", + "serde", ] [[package]] -name = "binascii" -version = "0.1.4" +name = "bitfield" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db1bcd90f88eabbf0cadbfb87a45bceeaebcd3b4bc9e43da379cd2ef0162590d" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3787a07661997bfc05dd3431e379c0188573f78857080cf682e1393ab8e4d64c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] [[package]] name = "bitflags" -version = "2.9.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.10.4" +name = "bitflags" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bleps" +version = "0.1.0" +source = "git+https://github.com/bjoernQ/bleps?rev=a5148d8ae679e021b78f53fd33afb8bb35d0b62e#a5148d8ae679e021b78f53fd33afb8bb35d0b62e" dependencies = [ - "generic-array", + "bitfield 0.14.0", + "bleps-dedup", + "bleps-macros", + "critical-section", + "embedded-io", + "embedded-io-async", + "futures", + "log", + "rand_core 0.6.4", +] + +[[package]] +name = "bleps-dedup" +version = "0.1.0" +source = "git+https://github.com/bjoernQ/bleps?rev=a5148d8ae679e021b78f53fd33afb8bb35d0b62e#a5148d8ae679e021b78f53fd33afb8bb35d0b62e" +dependencies = [ + "darling", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "bleps-macros" +version = "0.1.0" +source = "git+https://github.com/bjoernQ/bleps?rev=a5148d8ae679e021b78f53fd33afb8bb35d0b62e#a5148d8ae679e021b78f53fd33afb8bb35d0b62e" +dependencies = [ + "litrs 0.2.3", + "proc-macro2", + "quote", + "syn 1.0.109", + "uuid", ] [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytemuck" -version = "1.22.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" [[package]] -name = "bytes" -version = "1.10.1" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "cc" -version = "1.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" -dependencies = [ - "shlex", -] +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] -name = "chrono" -version = "0.4.40" +name = "const-sha1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-link", -] +checksum = "0d8a42181e0652c2997ae4d217f25b63c5337a52fd2279736e97b832fa0a3cff" [[package]] -name = "cookie" -version = "0.18.1" +name = "critical-section" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crypto-common" @@ -222,45 +154,55 @@ dependencies = [ ] [[package]] -name = "deranged" -version = "0.4.0" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "powerfmt", + "darling_core", + "darling_macro", ] [[package]] -name = "devise" -version = "0.4.2" +name = "darling_core" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d90b0c4c777a2cad215e3c7be59ac7c15adf45cf76317009b7d096d46f651d" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ - "devise_codegen", - "devise_core", -] - -[[package]] -name = "devise_codegen" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b28680d8be17a570a2334922518be6adc3f58ecc880cbb404eaeb8624fd867" -dependencies = [ - "devise_core", - "quote", -] - -[[package]] -name = "devise_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" -dependencies = [ - "bitflags", + "fnv", + "ident_case", "proc-macro2", - "proc-macro2-diagnostics", "quote", - "syn", + "strsim", + "syn 2.0.104", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "delegate" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -269,15 +211,215 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", "crypto-common", ] [[package]] -name = "either" -version = "1.15.0" +name = "document-features" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs 0.4.1", +] + +[[package]] +name = "edge-dhcp" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ccd3a181a33c710e07c3f04623d7a11e9969b1e44a7276ead7873b049720cb" +dependencies = [ + "edge-nal", + "edge-raw", + "embassy-futures", + "embassy-time", + "heapless", + "log", + "num_enum", + "rand_core 0.6.4", +] + +[[package]] +name = "edge-nal" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac19c3edcdad839c71cb919cd09a632d9915d630760b37f0b74290188c08f248" +dependencies = [ + "embassy-time", + "embedded-io-async", +] + +[[package]] +name = "edge-nal-embassy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252f89adf4f0016631977bec3ba50d768263a3a9fa9f023b4087088a619568ce" +dependencies = [ + "edge-nal", + "embassy-futures", + "embassy-net", + "embedded-io-async", + "heapless", + "log", +] + +[[package]] +name = "edge-raw" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6207c84e9bc8df8ef3c155196df290f2a51f010bd60c2e78366e51979988bdb5" + +[[package]] +name = "embassy-embedded-hal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8578db196d74db92efdd5ebc546736dac1685499ee245b22eff92fa5e4b57945" +dependencies = [ + "embassy-futures", + "embassy-hal-internal", + "embassy-sync 0.7.0", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-hal-internal" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a" +dependencies = [ + "num-traits", +] + +[[package]] +name = "embassy-net" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940c4b9fe5c1375b09a0c6722c0100d6b2ed46a717a34f632f26e8d7327c4383" +dependencies = [ + "document-features", + "embassy-net-driver", + "embassy-sync 0.6.2", + "embassy-time", + "embedded-io-async", + "embedded-nal-async", + "heapless", + "managed", + "smoltcp", +] + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless", +] + +[[package]] +name = "embassy-sync" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef1a8a1ea892f9b656de0295532ac5d8067e9830d49ec75076291fd6066b136" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embassy-time-queue-utils", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" +dependencies = [ + "embassy-executor", + "heapless", +] + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" +dependencies = [ + "nb 1.1.0", +] [[package]] name = "embedded-hal" @@ -296,22 +438,82 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" [[package]] -name = "embedded-hal-nb" +name = "embedded-hal-async" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" dependencies = [ "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-nal" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77" +dependencies = [ "nb 1.1.0", ] [[package]] -name = "encoding_rs" -version = "0.8.35" +name = "embedded-nal-async" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211" dependencies = [ - "cfg-if", + "embedded-io-async", + "embedded-nal", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "enumset" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ee17054f550fd7400e1906e2f9356c7672643ed34008a9e8abe147ccd2d821" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d07902c93376f1e96c34abc4d507c0911df3816cef50b01f5a2ff3ad8c370d" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -321,41 +523,308 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "errno" -version = "0.3.11" +name = "esp-alloc" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "7e95f1de57ce5a6600368f3d3c931b0dfe00501661e96f5ab83bc5cdee031784" dependencies = [ - "libc", - "windows-sys 0.59.0", + "allocator-api2", + "cfg-if", + "critical-section", + "document-features", + "enumset", + "linked_list_allocator", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "esp-config" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "figment" -version = "0.10.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +checksum = "abd4a8db4b72794637a25944bc8d361c3cc271d4f03987ce8741312b6b61529c" dependencies = [ - "atomic 0.6.0", - "pear", + "document-features", + "esp-metadata-generated", + "evalexpr", "serde", - "toml", - "uncased", - "version_check", + "serde_yaml", ] +[[package]] +name = "esp-hal" +version = "1.0.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3887eda2917deef3d99e7a5c324f9190714e99055361ad36890dffd0a995b49" +dependencies = [ + "bitfield 0.19.1", + "bitflags 2.9.1", + "bytemuck", + "cfg-if", + "critical-section", + "delegate", + "digest", + "document-features", + "embassy-embedded-hal", + "embassy-futures", + "embassy-sync 0.6.2", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-config", + "esp-hal-procmacros", + "esp-metadata-generated", + "esp-riscv-rt", + "esp-rom-sys", + "esp32", + "esp32c2", + "esp32c3", + "esp32c6", + "esp32h2", + "esp32s2", + "esp32s3", + "fugit", + "instability", + "log", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core 0.6.4", + "rand_core 0.9.3", + "riscv", + "serde", + "strum", + "ufmt-write", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d000d94064c485f86adc6b02b541e2f072e03321b4f03d4303b7ff3062c7e692" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-executor", + "embassy-sync 0.6.2", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata-generated", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbece384edaf0d1eabfa45afa96d910634d4158638ef983b2d419a8dec832246" +dependencies = [ + "document-features", + "litrs 0.4.1", + "object", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.104", + "termcolor", +] + +[[package]] +name = "esp-metadata" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6fbc1d166be84c0750f121e95c8989ddebd7e7bdd86af3594a6cfb34f039650" +dependencies = [ + "anyhow", + "basic-toml", + "indexmap", + "proc-macro2", + "quote", + "serde", + "strum", +] + +[[package]] +name = "esp-metadata-generated" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d36b8c8a752bdebec67fd02a15ebb1432feea345553749bca7ce2393cc795" +dependencies = [ + "esp-metadata", +] + +[[package]] +name = "esp-println" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e7e3ab41e96093d7fd307e93bfc88bd646a8ff23036ebf809e116b18869f719" +dependencies = [ + "critical-section", + "document-features", + "esp-metadata-generated", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a00370dfcb0ccc01c6b2540076379c6efd6890a27f584de217c38e3239e19d5" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp-rom-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "646aca2b30503b6c6f34250255fbd5887fd0c4104ea90802c1fea34f3035e7d6" +dependencies = [ + "cfg-if", + "document-features", + "esp-metadata-generated", +] + +[[package]] +name = "esp-wifi" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84908f2e95cb99a200cf448abafc416576338be590778a15d9224eee237f3210" +dependencies = [ + "allocator-api2", + "cfg-if", + "critical-section", + "document-features", + "embassy-net-driver", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-alloc", + "esp-config", + "esp-hal", + "esp-metadata-generated", + "esp-wifi-sys", + "log", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "rand_core 0.9.3", +] + +[[package]] +name = "esp-wifi-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5438361891c431970194a733415006fb3d00b6eb70b3dcb66fd58f04d9b39" +dependencies = [ + "anyhow", + "log", +] + +[[package]] +name = "esp32" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7680f79e3a4770e59c2dc25b17dcd852921ee57ffae9a4c4806c9ca5001d54d" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c2" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da1bcf86fca83543e0e95561cba27bbcc6b6e7adc5428f49187f5868bc0c3ed2" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c3" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce2c5a33d4377f974cbe8cadf8307f04f2c39755704cb09e81852c63ee4ac7b8" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c6" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca8fc81b7164df58b5e04aaac9e987459312e51903cca807317990293973a6e" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32h2" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80171d08c17d8c63b53334c60ca654786a7593481531d19b639c4e5c76d276de" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32s2" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c90d347480fca91f4be3e94b576af9c6c7987795c58dc3c5a7c108b6b3966dc" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32s3" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3769c56222c4548833f236c7009f1f8b3f2387af26366f6bd1cea456666a49d" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "evalexpr" +version = "12.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02a3229bec56a977f174b32fe7b8d89e8c79ebb4493d10ad763b6676dc2dc0c9" + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + [[package]] name = "futures" version = "0.3.31" @@ -410,50 +879,44 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "futures-channel", "futures-core", - "futures-io", "futures-sink", "futures-task", - "memchr", "pin-project-lite", "pin-utils", - "slab", ] [[package]] name = "fw-anwesenheit" version = "0.1.0" dependencies = [ - "anyhow", - "chrono", - "gpio", + "bleps", + "critical-section", + "edge-dhcp", + "edge-nal", + "edge-nal-embassy", + "embassy-executor", + "embassy-net", + "embassy-time", + "embedded-io", + "embedded-io-async", + "esp-alloc", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "esp-wifi", + "heapless", "log", - "regex", - "rgb", - "rocket", - "rppal", - "rust-embed", - "serde", - "serde_json", - "simplelog", - "smart-leds", - "tokio", - "ws2812-spi", + "picoserve", + "smoltcp", + "static_cell", ] [[package]] -name = "generator" -version = "0.7.5" +name = "gcd" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows", -] +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" [[package]] name = "generic-array" @@ -466,181 +929,48 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "hash32" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "gpio" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe6783270536547ac473c9d2ae5a7e0e715ea43f29004ced47fbd1c1372d2c7" - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", + "byteorder", ] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "heapless" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32", + "serde", + "stable_deref_trait", +] [[package]] -name = "hermit-abi" +name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "http" -version = "0.2.12" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", @@ -648,20 +978,22 @@ dependencies = [ ] [[package]] -name = "inlinable_string" -version = "0.1.15" +name = "indoc" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" [[package]] -name = "is-terminal" -version = "0.4.16" +name = "instability" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +checksum = "435d80800b936787d62688c927b6490e887c7ef5ff9ce922c6c6050fca75eb9a" dependencies = [ - "hermit-abi 0.5.0", - "libc", - "windows-sys 0.59.0", + "darling", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -681,31 +1013,33 @@ dependencies = [ ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "lhash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "744a4c881f502e98c2241d2e5f50040ac73b30194d64452bb6260393b53f0dc9" [[package]] -name = "libc" -version = "0.2.172" +name = "linked_list_allocator" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" [[package]] -name = "linux-raw-sys" -version = "0.9.4" +name = "litrs" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa" dependencies = [ - "autocfg", - "scopeguard", + "proc-macro2", +] + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", ] [[package]] @@ -715,79 +1049,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] -name = "loom" -version = "0.5.6" +name = "managed" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] +checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - -[[package]] -name = "multer" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 1.3.1", - "httparse", - "memchr", - "mime", - "spin", - "tokio", - "tokio-util", - "version_check", -] +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "nb" @@ -805,21 +1076,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "num-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "overload", - "winapi", + "proc-macro2", + "quote", + "syn 2.0.104", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" version = "0.2.19" @@ -830,22 +1096,24 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "num_enum" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" dependencies = [ - "hermit-abi 0.3.9", - "libc", + "num_enum_derive", + "rustversion", ] [[package]] -name = "num_threads" -version = "0.1.7" +name = "num_enum_derive" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "libc", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -864,63 +1132,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "overload" -version = "0.1.1" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "parking_lot" -version = "0.12.3" +name = "picoserve" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "33c13ee221d37df77538b033b831099235067c6a3fdcd2b80ef46c3d5b96e3b2" dependencies = [ - "lock_api", - "parking_lot_core", + "const-sha1", + "data-encoding", + "embassy-net", + "embassy-time", + "embedded-io-async", + "futures-util", + "heapless", + "lhash", + "log", + "picoserve_derive", + "ryu", + "serde", + "serde-json-core", + "thiserror", ] [[package]] -name = "parking_lot_core" -version = "0.9.10" +name = "picoserve_derive" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "pear" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" -dependencies = [ - "inlinable_string", - "pear_codegen", - "yansi", -] - -[[package]] -name = "pear_codegen" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" +checksum = "82a7350bdbef1ef80e4f058b89ca974dcc6526b04ac4d2095763b69760abf7ea" dependencies = [ "proc-macro2", - "proc-macro2-diagnostics", "quote", - "syn", + "syn 2.0.104", ] -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - [[package]] name = "pin-project-lite" version = "0.2.16" @@ -934,18 +1183,63 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "powerfmt" -version = "0.2.0" +name = "portable-atomic" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] -name = "ppv-lite86" -version = "0.2.21" +name = "portable_atomic_enum" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" dependencies = [ - "zerocopy", + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", ] [[package]] @@ -957,19 +1251,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", -] - [[package]] name = "quote" version = "1.0.40" @@ -980,278 +1261,69 @@ dependencies = [ ] [[package]] -name = "r-efi" -version = "5.2.0" +name = "r0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" + +[[package]] +name = "riscv" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea8ff73d3720bdd0a97925f0bf79ad2744b6da8ff36be3840c48ac81191d7a7" dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "redox_syscall" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" -dependencies = [ - "bitflags", -] - -[[package]] -name = "ref-cast" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rgb" -version = "0.8.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "rocket" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" -dependencies = [ - "async-stream", - "async-trait", - "atomic 0.5.3", - "binascii", - "bytes", - "either", - "figment", - "futures", - "indexmap", - "log", - "memchr", - "multer", - "num_cpus", - "parking_lot", - "pin-project-lite", - "rand", - "ref-cast", - "rocket_codegen", - "rocket_http", - "serde", - "serde_json", - "state", - "tempfile", - "time", - "tokio", - "tokio-stream", - "tokio-util", - "ubyte", - "version_check", - "yansi", -] - -[[package]] -name = "rocket_codegen" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" -dependencies = [ - "devise", - "glob", - "indexmap", - "proc-macro2", - "quote", - "rocket_http", - "syn", - "unicode-xid", - "version_check", -] - -[[package]] -name = "rocket_http" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" -dependencies = [ - "cookie", - "either", - "futures", - "http 0.2.12", - "hyper", - "indexmap", - "log", - "memchr", - "pear", - "percent-encoding", - "pin-project-lite", - "ref-cast", - "serde", - "smallvec", - "stable-pattern", - "state", - "time", - "tokio", - "uncased", -] - -[[package]] -name = "rppal" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ce3b019009cff02cb6b0e96e7cc2e5c5b90187dc1a490f8ef1521d0596b026" -dependencies = [ - "embedded-hal 0.2.7", + "critical-section", "embedded-hal 1.0.0", - "embedded-hal-nb", - "libc", - "nb 0.1.3", - "spin_sleep", - "void", + "paste", + "riscv-macros", + "riscv-pac", ] [[package]] -name = "rust-embed" -version = "8.7.0" +name = "riscv-macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5fbc0ee50fcb99af7cebb442e5df7b5b45e9460ffa3f8f549cd26b862bec49d" -dependencies = [ - "rust-embed-impl", - "rust-embed-utils", - "walkdir", -] - -[[package]] -name = "rust-embed-impl" -version = "8.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf418c9a2e3f6663ca38b8a7134cc2c2167c9d69688860e8961e3faa731702e" +checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25" dependencies = [ "proc-macro2", "quote", - "rust-embed-utils", - "syn", - "walkdir", + "syn 2.0.104", ] [[package]] -name = "rust-embed-utils" -version = "8.7.0" +name = "riscv-pac" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d55b95147fe01265d06b3955db798bdaed52e60e2211c41137701b3aba8e21" -dependencies = [ - "sha2", - "walkdir", -] +checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" [[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "riscv-rt-macros" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustix" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "fc71814687c45ba4cd1e47a54e03a2dbc62ca3667098fbae9cc6b423956758fa" dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" @@ -1259,27 +1331,6 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "serde" version = "1.0.219" @@ -1289,6 +1340,17 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-json-core" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b81787e655bd59cecadc91f7b6b8651330b2be6c33246039a65e5cd6f4e0828" +dependencies = [ + "heapless", + "ryu", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.219" @@ -1297,157 +1359,82 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] -name = "serde_json" -version = "1.0.140" +name = "serde_yaml" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ + "indexmap", "itoa", - "memchr", "ryu", "serde", + "unsafe-libyaml", ] [[package]] -name = "serde_spanned" -version = "0.6.8" +name = "smoltcp" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" dependencies = [ + "bitflags 1.3.2", + "byteorder", "cfg-if", - "cpufeatures", - "digest", + "heapless", + "managed", ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23" dependencies = [ - "lazy_static", + "portable-atomic", ] [[package]] -name = "shlex" -version = "1.3.0" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "signal-hook-registry" -version = "1.4.2" +name = "strum" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ - "libc", + "strum_macros", ] [[package]] -name = "simplelog" -version = "0.12.2" +name = "strum_macros" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ - "log", - "termcolor", - "time", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" - -[[package]] -name = "smart-leds" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd45fa275f70b4110eac5f5182611ad384f88bb22b68b9a9c3cafd7015290b" -dependencies = [ - "smart-leds-trait", -] - -[[package]] -name = "smart-leds-trait" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf6d833fa93f16a1c1874e62c2aebe8567e5bdd436d59bf543ed258b6f7a8e3" -dependencies = [ - "rgb", -] - -[[package]] -name = "socket2" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spin_sleep" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17db5ecef7e0bebeb8bf8bc4c4b554e05e0205d7008f10bb37787892e7a6507b" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "stable-pattern" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" -dependencies = [ - "memchr", -] - -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", + "heck", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] name = "syn" -version = "2.0.100" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1455,16 +1442,14 @@ dependencies = [ ] [[package]] -name = "tempfile" -version = "3.19.1" +name = "syn" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ - "fastrand", - "getrandom 0.3.2", - "once_cell", - "rustix", - "windows-sys 0.59.0", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -1477,208 +1462,42 @@ dependencies = [ ] [[package]] -name = "thread_local" -version = "1.1.8" +name = "thiserror" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "cfg-if", - "once_cell", + "thiserror-impl", ] [[package]] -name = "time" -version = "0.3.41" +name = "thiserror-impl" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" - -[[package]] -name = "time-macros" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tokio" -version = "1.44.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "tokio-stream" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", + "syn 2.0.104", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "typenum" version = "1.18.0" @@ -1686,23 +1505,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] -name = "ubyte" -version = "0.10.4" +name = "ufmt-write" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" -dependencies = [ - "serde", -] - -[[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" -dependencies = [ - "serde", - "version_check", -] +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] name = "unicode-ident" @@ -1711,16 +1517,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] -name = "unicode-xid" -version = "0.2.6" +name = "unsafe-libyaml" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] -name = "valuable" -version = "0.1.1" +name = "uuid" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" [[package]] name = "version_check" @@ -1734,40 +1550,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] - [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -1790,7 +1572,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -1812,7 +1594,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1826,112 +1608,13 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-core" -version = "0.61.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-implement" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.59.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-result" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", + "windows-sys", ] [[package]] @@ -1940,22 +1623,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1964,46 +1632,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2016,48 +1666,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -2066,58 +1692,41 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.6" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "xtensa-lx" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +checksum = "3a564fffeb3cd773a524e8d8a5c66ca5e9739ea7450e36a3e6a54dd31f1e652f" dependencies = [ - "bitflags", + "critical-section", ] [[package]] -name = "ws2812-spi" -version = "0.3.0" +name = "xtensa-lx-rt" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c2ba0d6c0ea9c117487411e93dc5dacaafc2c17698677a03d1c67901d4c70a" +checksum = "520a8fb0121eb6868f4f5ff383e262dc863f9042496724e01673a98a9b7e6c2b" dependencies = [ - "embedded-hal 0.2.7", - "nb 0.1.3", - "smart-leds-trait", + "document-features", + "r0", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", ] [[package]] -name = "yansi" -version = "1.0.1" +name = "xtensa-lx-rt-proc-macros" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -dependencies = [ - "is-terminal", -] - -[[package]] -name = "zerocopy" -version = "0.8.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +checksum = "c5a56a616147f5947ceb673790dd618d77b30e26e677f4a896df049d73059438" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] diff --git a/Cargo.toml b/Cargo.toml index 2bd6631..9cd351b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,24 +3,72 @@ name = "fw-anwesenheit" version = "0.1.0" edition = "2024" -[features] -default = [] -mock_pi = [] # Enable mocking of the rpi hardware +[[bin]] +name = "fw-anwesenheit" +path = "./src/bin/main.rs" +test = false +doctest = false +bench = false [dependencies] -chrono = { version = "0.4.40", features = ["serde"] } -gpio = "0.4.1" -regex = "1.11.1" -serde = { version = "1.0.219", features = ["derive"] } -serde_json = "1.0.140" -rocket = { version = "0.5.1", features = ["json"] } -tokio = { version = "1.44.2", features = ["full"] } -rust-embed = "8.7.0" -log = "0.4.27" -simplelog = "0.12.2" -rppal = { version = "0.22.1", features = ["hal"] } -smart-leds = "0.3" -ws2812-spi = "0.3" -rgb = "0.8.50" -anyhow = "1.0.98" +embassy-net = { version = "0.7.0", features = [ + "dhcpv4", + "medium-ethernet", + "tcp", + "udp", +] } +embedded-io = "0.6.1" +embedded-io-async = "0.6.1" +esp-alloc = "0.8.0" +esp-hal = { version = "1.0.0-beta.1", features = ["esp32c6", "unstable"] } +smoltcp = { version = "0.12.0", default-features = false, features = [ + "medium-ethernet", + "multicast", + "proto-dhcpv4", + "proto-dns", + "proto-ipv4", + "socket-dns", + "socket-icmp", + "socket-raw", + "socket-tcp", + "socket-udp", +] } +# for more networking protocol support see https://crates.io/crates/edge-net +bleps = { git = "https://github.com/bjoernQ/bleps", package = "bleps", rev = "a5148d8ae679e021b78f53fd33afb8bb35d0b62e", features = [ + "async", + "macros", +] } +critical-section = "1.2.0" +embassy-executor = { version = "0.7.0", features = ["task-arena-size-20480"] } +embassy-time = { version = "0.4.0", features = ["generic-queue-8"] } +esp-hal-embassy = { version = "0.9.0", features = ["esp32c6"] } +esp-wifi = { version = "0.15.0", features = [ + "wifi", + "builtin-scheduler", + "esp-alloc", + "esp32c6", + "log-04", +] } +heapless = { version = "0.8.0", default-features = false } +static_cell = { version = "2.1.0", features = ["nightly"] } +esp-println = { version = "0.15.0", features = ["esp32c6", "log-04"] } +log = { version = "0.4" } +edge-dhcp = { version = "0.6.0", features = ["log"] } +edge-nal = "0.5.0" +edge-nal-embassy = { version = "0.6.0", features = ["log"] } +picoserve = { version = "0.16.0", features = ["embassy", "log"] } + +[profile.dev] +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" + +[profile.release] +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 's' +overflow-checks = false diff --git a/Makefile b/Makefile deleted file mode 100644 index 5e8e950..0000000 --- a/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -PACKAGE_NAME := fwa -VERSION := 1.0 -ARCH := armhf -BUILD_DIR := build -DEB_DIR := $(BUILD_DIR)/$(PACKAGE_NAME)-$(VERSION) -BIN_DIR := $(DEB_DIR)/usr/local/bin -SERVICE_DIR := $(DEB_DIR)/lib/systemd/system -CONFIG_DIR := $(DEB_DIR)/etc -PM3_DIR := $(DEB_DIR)/usr/share/pm3 - -.PHONY: all build clean package prepare_package - -all: package - -build: $(BUILD_DIR)/fwa - -$(BUILD_DIR)/fwa: web/dist - cross build --release --target arm-unknown-linux-gnueabihf - cp ./target/arm-unknown-linux-gnueabihf/release/fw-anwesenheit $@ - -prepare_package: $(DEB_DIR)/DEBIAN $(BIN_DIR)/fwa - mkdir -p $(SERVICE_DIR) - cp ./service/fwa.service $(SERVICE_DIR)/ - cp ./service/fwa-fail.service $(SERVICE_DIR)/ - - mkdir -p $(CONFIG_DIR) - cp ./service/fwa.env $(CONFIG_DIR)/ - - mkdir -p $(PM3_DIR) - cp -r ./pre-compiled/* $(PM3_DIR)/ - - mkdir -p $(DEB_DIR)/var/lib/fwa/ - -$(BIN_DIR)/fwa: $(BUILD_DIR)/fwa - mkdir -p $(BIN_DIR) - cp $< $@ - - -$(DEB_DIR)/DEBIAN: - mkdir -p $(DEB_DIR)/DEBIAN - echo "Package: $(PACKAGE_NAME)" > $(DEB_DIR)/DEBIAN/control - echo "Version: $(VERSION)" >> $(DEB_DIR)/DEBIAN/control - echo "Section: utils" >> $(DEB_DIR)/DEBIAN/control - echo "Priority: optional" >> $(DEB_DIR)/DEBIAN/control - echo "Architecture: $(ARCH)" >> $(DEB_DIR)/DEBIAN/control - echo "Depends: libc6 (>= 2.28)" >> $(DEB_DIR)/DEBIAN/control - echo "Maintainer: Niklas Kapelle " >> $(DEB_DIR)/DEBIAN/control - echo "Description: Feuerwehr anwesenheit" >> $(DEB_DIR)/DEBIAN/control - - echo "/etc/fwa.env" > $(DEB_DIR)/DEBIAN/conffiles - -web/dist: - (cd web && npm run build) - -package: prepare_package - dpkg-deb --build $(DEB_DIR) - -clean: - cargo clean - rm -rf web/dist - rm -rf $(BUILD_DIR) diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..512e10e --- /dev/null +++ b/build.rs @@ -0,0 +1,40 @@ +fn main() { + linker_be_nice(); + // make sure linkall.x is the last linker script (otherwise might cause problems with flip-link) + println!("cargo:rustc-link-arg=-Tlinkall.x"); +} + +fn linker_be_nice() { + let args: Vec = std::env::args().collect(); + if args.len() > 1 { + let kind = &args[1]; + let what = &args[2]; + + match kind.as_str() { + "undefined-symbol" => match what.as_str() { + "_defmt_timestamp" => { + eprintln!(); + eprintln!("💡 `defmt` not found - make sure `defmt.x` is added as a linker script and you have included `use defmt_rtt as _;`"); + eprintln!(); + } + "_stack_start" => { + eprintln!(); + eprintln!("💡 Is the linker script `linkall.x` missing?"); + eprintln!(); + } + _ => (), + }, + // we don't have anything helpful for "missing-lib" yet + _ => { + std::process::exit(1); + } + } + + std::process::exit(0); + } + + println!( + "cargo:rustc-link-arg=--error-handling-script={}", + std::env::current_exe().unwrap().display() + ); +} diff --git a/buzzer.py b/buzzer.py deleted file mode 100644 index c39f070..0000000 --- a/buzzer.py +++ /dev/null @@ -1,24 +0,0 @@ -import RPi.GPIO as GPIO -import time - -BUZZER_PIN = 26 - -def beep(frequency, duration): - pwm = GPIO.PWM(BUZZER_PIN, frequency) - pwm.start(50) # 50 % duty cycle - time.sleep(duration) - pwm.stop() - -def main(): - GPIO.setmode(GPIO.BCM) - GPIO.setup(BUZZER_PIN, GPIO.OUT) - - try: - beep(523, 0.3) # C5 - beep(659, 0.3) # E5 - beep(784, 0.3) # G5 - finally: - GPIO.cleanup() - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/doc/Sequence_diagram.svg b/doc/Sequence_diagram.svg deleted file mode 100644 index c0fa20a..0000000 --- a/doc/Sequence_diagram.svg +++ /dev/null @@ -1 +0,0 @@ -userusermainmainpm3pm3parserparseridstoreidstoreSystemSystemattendence_daysystemsystemstartlooplook for HITAGshow HITAGparse IDreturn IDsend IDlooplook for IDssend IDask for dayaltreturn attendence_daycreate new attendence_dayattendence_dayadd IDsave json \ No newline at end of file diff --git a/doc/Sequence_diagram.wsd b/doc/Sequence_diagram.wsd deleted file mode 100644 index 3ca6b54..0000000 --- a/doc/Sequence_diagram.wsd +++ /dev/null @@ -1,34 +0,0 @@ -@startuml -actor user - - -main -> pm3 :start -loop - pm3 -> pm3 : look for HITAG -end - -user -> pm3 :show HITAG - -pm3 -> parser : parse ID -parser -> pm3 : return ID - -pm3 --> main : send ID - -loop - main -> main : look for IDs -end - -main -> idstore : send ID -idstore -> System : ask for day -alt - System -> idstore : return attendence_day -else - create collections attendence_day - idstore -> attendence_day : create new attendence_day - -end - -idstore -> attendence_day : add ID -attendence_day -> system : save json - -@enduml \ No newline at end of file diff --git a/pm3_mock.sh b/pm3_mock.sh deleted file mode 100755 index debf719..0000000 --- a/pm3_mock.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -generate_random_hex() { - openssl rand -hex 4 | tr '[:lower:]' '[:upper:]' -} - -output_hotspot_id() { - echo "[+] UID.... C1532B57" -} - -trap 'output_hotspot_id' SIGUSR1 - -echo "Proxmark 3 mock script" -echo "Outputs a random ID every 1 to 5 seconds" - -while true; do - random_id=$(generate_random_hex) - echo "[+] UID.... $random_id" - if (( RANDOM % 2 == 0 )); then - echo "[+] UID.... $random_id" - fi - sleep "$((RANDOM % 5 + 1))" -done diff --git a/pre-compiled/bootrom.bin b/pre-compiled/bootrom.bin deleted file mode 100644 index 221231e..0000000 Binary files a/pre-compiled/bootrom.bin and /dev/null differ diff --git a/pre-compiled/fullimage.bin b/pre-compiled/fullimage.bin deleted file mode 100644 index a49f771..0000000 Binary files a/pre-compiled/fullimage.bin and /dev/null differ diff --git a/pre-compiled/pm3 b/pre-compiled/pm3 deleted file mode 100755 index 80aad83..0000000 --- a/pre-compiled/pm3 +++ /dev/null @@ -1,550 +0,0 @@ -#!/usr/bin/env bash - -# Usage: run option -h to get help - -# BT auto detection -# Shall we look for white HC-06-USB dongle ? -FINDBTDONGLE=true -# Shall we look for rfcomm interface ? -FINDBTRFCOMM=true -# Shall we look for registered BT device ? (Linux only) -FINDBTDIRECT=true - -PM3PATH=$(dirname "$0") -EVALENV="" -FULLIMAGE="fullimage.elf" -BOOTIMAGE="bootrom.elf" - -#Skip check if --list is used -if [ ! "$1" == "--list" ]; then - # try pm3 dirs in current repo workdir - if [ -d "$PM3PATH/client/" ]; then - if [ -x "$PM3PATH/client/proxmark3" ]; then - CLIENT="$PM3PATH/client/proxmark3" - elif [ -x "$PM3PATH/client/build/proxmark3" ]; then - CLIENT="$PM3PATH/client/build/proxmark3" - else - echo >&2 "[!!] In devel workdir but no executable found, did you compile it?" - exit 1 - fi - # try install dir - elif [ -x "$PM3PATH/proxmark3" ]; then - CLIENT="$PM3PATH/proxmark3" - else - # hope it's installed somehow, still not sure where fw images and pm3.py are... - CLIENT="proxmark3" - fi -fi - -# LeakSanitizer suppressions -if [ -e .lsan_suppressions ]; then - EVALENV+=" LSAN_OPTIONS=suppressions=.lsan_suppressions" -fi -if [ "$EVALENV" != "" ]; then - EVALENV="export $EVALENV" -fi -PM3LIST=() -SHOWLIST=false - -function get_pm3_list_Linux { - N=$1 - PM3LIST=() - if [ ! -c "/dev/tty0" ]; then - echo >&2 "[!!] Script cannot access /dev/ttyXXX files, insufficient privileges" - exit 1 - fi - for DEV in $(find /dev/ttyACM* 2>/dev/null); do - if command -v udevadm >/dev/null; then - # WSL1 detection - if udevadm info -q property -n "$DEV" | grep -q "ID_VENDOR=proxmark.org"; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - fi - # WSL2 with usbipd detection - doesn't report same things as WSL1 - if grep -q "proxmark.org" "/sys/class/tty/${DEV#/dev/}/../../../manufacturer" 2>/dev/null; then - if echo "${PM3LIST[*]}" | grep -qv "${DEV}"; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - fi - done - if $FINDBTDONGLE; then - # check if the HC-06-USB white dongle is present (still, that doesn't tell us if it's paired with a Proxmark3...) - for DEV in $(find /dev/ttyUSB* 2>/dev/null); do - if command -v udevadm >/dev/null; then - if udevadm info -q property -n "$DEV" | grep -q "ID_MODEL=CP2104_USB_to_UART_Bridge_Controller"; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - else - if grep -q "DRIVER=cp210x" "/sys/class/tty/${DEV#/dev/}/../../uevent" 2>/dev/null; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - fi - done - fi - if $FINDBTRFCOMM; then - # check if the MAC of a Proxmark3 was bound to a local rfcomm interface - # (on OSes without deprecated rfcomm and hcitool, the loop will be simply skipped) - for DEVMAC in $(rfcomm -a 2>/dev/null | grep " 20:19:0[45]" | sed 's/^\(.*\): \([0-9:]*\) .*/\1@\2/'); do - DEV=${DEVMAC/@*/} - MAC=${DEVMAC/*@/} - # check which are Proxmark3 and, side-effect, if they're actually present - if hcitool name "$MAC" | grep -q "PM3"; then - PM3LIST+=("/dev/$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - done - fi - if $FINDBTDIRECT; then - # check if the MAC of a Proxmark3 was registered in the known devices - for MAC in $(dbus-send --system --print-reply --type=method_call --dest='org.bluez' '/' org.freedesktop.DBus.ObjectManager.GetManagedObjects 2>/dev/null|\ - awk '/"Address"/{getline;gsub(/"/,"",$3);a=$3}/Name/{getline;if (/PM3_RDV4/ || /Proxmark3 SE/) print a}'); do - PM3LIST+=("bt:$MAC") - done - # we don't probe the device so there is no guarantee the device is actually present - fi -} - -function get_pm3_list_macOS { - N=$1 - PM3LIST=() - for DEV in $(ioreg -r -c "IOUSBHostDevice" -l | awk -F '"' ' - $2=="USB Vendor Name"{b=($4=="proxmark.org")} - b==1 && $2=="IODialinDevice"{print $4}'); do - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - done -} - -function get_pm3_list_Windows { - N=$1 - PM3LIST=() - - # Normal SERIAL PORTS (COM) - for DEV in $(wmic /locale:ms_409 path Win32_SerialPort Where "PNPDeviceID LIKE '%VID_9AC4&PID_4B8F%' Or PNPDeviceID LIKE '%VID_2D2D&PID_504D%'" Get DeviceID 2>/dev/null | awk -b '/^COM/{print $1}'); do - DEV=${DEV/ */} - #prevent soft bricking when using pm3-flash-all on an outdated bootloader - if [ $(basename -- "$0") = "pm3-flash-all" ]; then - line=$(wmic /locale:ms_409 path Win32_SerialPort Where "DeviceID='$DEV'" Get PNPDeviceID 2>/dev/null | awk -b '/^USB/{print $1}'); - if [[ ! $line =~ ^"USB\VID_9AC4&PID_4B8F\ICEMAN" ]]; then - echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!" - exit 1 - fi - fi - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - done - - #BT direct SERIAL PORTS (COM) - if $FINDBTRFCOMM; then - for DEV in $(wmic /locale:ms_409 path Win32_PnPEntity Where "Caption LIKE '%Bluetooth%(COM%'" Get Name 2> /dev/null | awk -b 'match($0,/(COM[0-9]+)/,m){print m[1]}'); do - DEV=${DEV/ */} - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - done - fi - - #white BT dongle SERIAL PORTS (COM) - if $FINDBTDONGLE; then - for DEV in $(wmic /locale:ms_409 path Win32_SerialPort Where "PNPDeviceID LIKE '%VID_10C4&PID_EA60%'" Get DeviceID 2>/dev/null | awk -b '/^COM/{print $1}'); do - DEV=${DEV/ */} - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - done - fi -} - -function get_pm3_list_WSL { - N=$1 - PM3LIST=() - - # Normal SERIAL PORTS (COM) - for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.PNPDeviceID -like '*VID_9AC4&PID_4B8F*' -or \$_.PNPDeviceID -like '*VID_2D2D&PID_504D*'} | Select -expandproperty DeviceID" 2>/dev/null); do - DEV=$(echo $DEV | tr -dc '[:print:]') - _comport=$DEV - DEV=$(echo $DEV | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p') - # ttyS counterpart takes some more time to appear - if [ -e "$DEV" ]; then - - #prevent soft bricking when using pm3-flash-all on an outdated bootloader - if [ $(basename -- "$0") = "pm3-flash-all" ]; then - line=$($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.DeviceID -eq '$_comport'} | Select -expandproperty PNPDeviceID" 2>/dev/null | tr -dc '[:print:]'); - if [[ ! $line =~ ^"USB\VID_9AC4&PID_4B8F\ICEMAN" ]]; then - echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!" - exit 1 - fi - fi - PM3LIST+=("$DEV") - if [ ! -w "$DEV" ]; then - echo "[!] Let's give users read/write access to $DEV" - sudo chmod 666 "$DEV" - fi - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - done - - #BT direct SERIAL PORTS (COM) - if $FINDBTRFCOMM; then - for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_PnPEntity | Where-Object Caption -like 'Standard Serial over Bluetooth link (COM*' | Select Name" 2> /dev/null | sed -nr 's#.*\bCOM([0-9]+)\b.*#/dev/ttyS\1#p'); do - # ttyS counterpart takes some more time to appear - if [ -e "$DEV" ]; then - PM3LIST+=("$DEV") - if [ ! -w "$DEV" ]; then - echo "[!] Let's give users read/write access to $DEV" - sudo chmod 666 "$DEV" - fi - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - - done - fi - - #white BT dongle SERIAL PORTS (COM) - if $FINDBTDONGLE; then - for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object PNPDeviceID -like '*VID_10C4&PID_EA60*' | Select DeviceID" 2>/dev/null | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p'); do - # ttyS counterpart takes some more time to appear - if [ -e "$DEV" ]; then - PM3LIST+=("$DEV") - if [ ! -w "$DEV" ]; then - echo "[!] Let's give users read/write access to $DEV" - sudo chmod 666 "$DEV" - fi - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return - fi - fi - - done - fi -} - -SCRIPT=$(basename -- "$0") - -if [ "$SCRIPT" = "pm3" ]; then - CMD() { eval "$EVALENV"; $CLIENT "$@"; } - HELP() { - cat << EOF - -Quick helper script for proxmark3 client when working with a Proxmark3 device - -Description: - The usage is the same as for the proxmark3 client, with the following differences: - * the correct port name will be automatically guessed; - * the script will wait for a Proxmark3 to be connected (same as option -w of the client). - You can also specify a first option -n N to access the Nth Proxmark3 connected. - To see a list of available ports, use --list. - -Usage: - $SCRIPT [-n ] [] - $SCRIPT [--list] [-h|--help] [-hh|--helpclient] - $SCRIPT [-o|--offline] - - -Arguments: - -h/--help this help - -hh/--helpclient proxmark3 client help (the script will forward these options) - --list list all detected com ports - -n connect device referred to the N:th number on the --list output - -o/--offline shortcut to use directly the proxmark3 client without guessing ports - -Samples: - ./$SCRIPT -- Auto detect/ select com port in the following order BT, USB/CDC, BT DONGLE - ./$SCRIPT -p /dev/ttyACM0 -- connect to port /dev/ttyACM0 - ./$SCRIPT -n 2 -- use second item from the --list output - ./$SCRIPT -c 'lf search' -i -- run command and stay in client once completed - - -EOF - } -elif [ "$SCRIPT" = "pm3-flash" ]; then - FINDBTDONGLE=false - FINDBTRFCOMM=false - FINDBTDIRECT=false - CMD() { - ARGS=("--port" "$1" "--flash") - shift; - while [ "$1" != "" ]; do - if [ "$1" == "-b" ]; then - ARGS+=("--unlock-bootloader") - elif [ "$1" == "--force" ]; then - ARGS+=("--force") - else - ARGS+=("--image" "$1") - fi - shift; - done - $CLIENT "${ARGS[@]}"; - } - HELP() { - cat << EOF -Quick helper script for flashing a Proxmark3 device via USB - -Description: - The usage is similar to the old proxmark3-flasher binary, except that the correct port name will be automatically guessed. - You can also specify a first option -n N to access the Nth Proxmark3 connected on USB. - If this doesn't work, you'll have to use manually the proxmark3 client, see "$CLIENT -h". - To see a list of available ports, use --list. - -Usage: - $SCRIPT [-n ] [-b] image.elf [image.elf...] - $SCRIPT --list - -Options: - -b Enable flashing of bootloader area (DANGEROUS) - -Example: - $SCRIPT -b bootrom.elf fullimage.elf -EOF - } -elif [ "$SCRIPT" = "pm3-flash-all" ]; then - FINDBTDONGLE=false - FINDBTRFCOMM=false - FINDBTDIRECT=false - - - CMD() { - ARGS=("--port" "$1" "--flash" "--unlock-bootloader" "--image" "$BOOTIMAGE" "--image" "$FULLIMAGE") - shift; - while [ "$1" != "" ]; do - if [ "$1" == "--force" ]; then - ARGS+=("--force") - fi - shift; - done - $CLIENT "${ARGS[@]}"; - } - HELP() { - cat << EOF -Quick helper script for flashing a Proxmark3 device via USB - -Description: - The correct port name will be automatically guessed and the stock bootloader and firmware image will be flashed. - You can also specify a first option -n N to access the Nth Proxmark3 connected on USB. - If this doesn't work, you'll have to use manually the proxmark3 client, see "$CLIENT -h". - To see a list of available ports, use --list. - -Usage: - $SCRIPT [-n ] - $SCRIPT --list -EOF - } -elif [ "$SCRIPT" = "pm3-flash-fullimage" ]; then - FINDBTDONGLE=false - FINDBTRFCOMM=false - FINDBTDIRECT=false - CMD() { - ARGS=("--port" "$1" "--flash" "--image" "$FULLIMAGE") - shift; - while [ "$1" != "" ]; do - if [ "$1" == "--force" ]; then - ARGS+=("--force") - fi - shift; - done - $CLIENT "${ARGS[@]}"; - } - HELP() { - cat << EOF -Quick helper script for flashing a Proxmark3 device via USB - -Description: - The correct port name will be automatically guessed and the stock firmware image will be flashed. - You can also specify a first option -n N to access the Nth Proxmark3 connected on USB. - If this doesn't work, you'll have to use manually the proxmark3 client, see "$CLIENT -h". - To see a list of available ports, use --list. - -Usage: - $SCRIPT [-n ] - $SCRIPT --list -EOF - } -elif [ "$SCRIPT" = "pm3-flash-bootrom" ]; then - FINDBTDONGLE=false - FINDBTRFCOMM=false - FINDBTDIRECT=false - CMD() { - ARGS=("--port" "$1" "--flash" "--unlock-bootloader" "--image" "$BOOTIMAGE") - shift; - while [ "$1" != "" ]; do - if [ "$1" == "--force" ]; then - ARGS+=("--force") - fi - shift; - done - $CLIENT "${ARGS[@]}"; - } - HELP() { - cat << EOF -Quick helper script for flashing a Proxmark3 device via USB - -Description: - The correct port name will be automatically guessed and the stock bootloader will be flashed. - You can also specify a first option -n N to access the Nth Proxmark3 connected on USB. - If this doesn't work, you'll have to use manually the proxmark3 client, see "$CLIENT -h". - To see a list of available ports, use --list. - -Usage: - $SCRIPT [-n ] - $SCRIPT --list -EOF - } -else - echo >&2 "[!!] Script ran under unknown name, abort: $SCRIPT" - exit 1 -fi - -# priority to the help options -for ARG; do - if [ "$ARG" == "-h" ] || [ "$ARG" == "--help" ]; then - HELP - exit 0 - fi - if [ "$ARG" == "-hh" ] || [ "$ARG" == "--helpclient" ]; then - CMD "-h" - exit 0 - fi -done - -# if offline, bypass the script and forward all other args -for ARG; do - shift - if [ "$ARG" == "-o" ] || [ "$ARG" == "--offline" ]; then - CMD "$@" - exit $? - fi - set -- "$@" "$ARG" -done - -# if a port is already provided, let's just run the command as such -for ARG; do - shift - if [ "$ARG" == "-p" ]; then - CMD "$@" - exit $? - fi - set -- "$@" "$ARG" -done - -if [ "$1" == "--list" ]; then - shift - if [ "$1" != "" ]; then - echo >&2 "[!!] Option --list must be used alone" - exit 1 - fi - SHOWLIST=true -fi - -# Number of the Proxmark3 we're interested in -N=1 -if [ "$1" == "-n" ]; then - shift - if [ "$1" -ge 1 ] && [ "$1" -lt 10 ]; then - N=$1 - shift - else - echo >&2 "[!!] Option -n requires a number between 1 and 9, got \"$1\"" - exit 1 - fi -fi - -HOSTOS=$(uname | awk '{print toupper($0)}') -if [ "$HOSTOS" = "LINUX" ]; then - # Detect when running under WSL1 (but exclude WSL2) - if uname -a | grep -qi Microsoft && uname -a | grep -qvi WSL2; then - # First try finding it using the PATH environment variable - PSHEXE=$(command -v powershell.exe 2>/dev/null) - - # If it fails (such as if WSLENV is not set), try using the default installation path - if [ -z "$PSHEXE" ]; then - PSHEXE=/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe - fi - - # Finally test if PowerShell is working - if ! "$PSHEXE" exit >/dev/null 2>&1; then - echo >&2 "[!!] Cannot run powershell.exe, are you sure your WSL is authorized to run Windows processes? (cf WSL interop flag)" - exit 1 - fi - - GETPM3LIST=get_pm3_list_WSL - else - GETPM3LIST=get_pm3_list_Linux - fi -elif [ "$HOSTOS" = "DARWIN" ]; then - GETPM3LIST=get_pm3_list_macOS -elif [[ "$HOSTOS" =~ MINGW(32|64)_NT* ]]; then - GETPM3LIST=get_pm3_list_Windows -else - echo >&2 "[!!] Host OS not recognized, abort: $HOSTOS" - exit 1 -fi - -if $SHOWLIST; then - # Probe for up to 9 devs - $GETPM3LIST 9 - if [ ${#PM3LIST} -lt 1 ]; then - echo >&2 "[!!] No port found" - exit 1 - fi - n=1 - for DEV in "${PM3LIST[@]}" - do - echo "$n: $DEV" - n=$((n+1)) - done - exit 0 -fi - -# Wait till we get at least N Proxmark3 devices -$GETPM3LIST "$N" -if [ ${#PM3LIST} -lt "$N" ]; then - echo >&2 "[=] Waiting for Proxmark3 to appear..." -fi -while true; do - if [ ${#PM3LIST[*]} -ge "$N" ]; then - break - fi - sleep .1 - $GETPM3LIST "$N" -done - -if [ ${#PM3LIST} -lt "$N" ]; then - HELP() { - cat << EOF -[!!] No port found, abort - -[?] Hint: try '$SCRIPT --list' to see list of available ports, and use the -n command like below -[?] $SCRIPT [-n ] - -EOF - } - HELP - exit 1 -fi - -CMD "${PM3LIST[$((N-1))]}" "$@" -exit $? diff --git a/pre-compiled/pm3-flash b/pre-compiled/pm3-flash deleted file mode 100755 index c5e920c..0000000 --- a/pre-compiled/pm3-flash +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -PM3PATH=$(dirname "$0") -. "$PM3PATH/pm3" diff --git a/pre-compiled/pm3-flash-all b/pre-compiled/pm3-flash-all deleted file mode 100755 index c5e920c..0000000 --- a/pre-compiled/pm3-flash-all +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -PM3PATH=$(dirname "$0") -. "$PM3PATH/pm3" diff --git a/pre-compiled/pm3-flash-bootrom b/pre-compiled/pm3-flash-bootrom deleted file mode 100755 index c5e920c..0000000 --- a/pre-compiled/pm3-flash-bootrom +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -PM3PATH=$(dirname "$0") -. "$PM3PATH/pm3" diff --git a/pre-compiled/pm3-flash-fullimage b/pre-compiled/pm3-flash-fullimage deleted file mode 100755 index c5e920c..0000000 --- a/pre-compiled/pm3-flash-fullimage +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -PM3PATH=$(dirname "$0") -. "$PM3PATH/pm3" diff --git a/pre-compiled/proxmark3 b/pre-compiled/proxmark3 deleted file mode 100755 index d1beeae..0000000 Binary files a/pre-compiled/proxmark3 and /dev/null differ diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..095fa4f --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly" +components = ["rust-src"] +targets = ["riscv32imac-unknown-none-elf"] diff --git a/service/fwa-fail.service b/service/fwa-fail.service deleted file mode 100644 index 378a2e8..0000000 --- a/service/fwa-fail.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Failure state for fwa.service -Requires=local-fs.target -After=local-fs.target -StartLimitIntervalSec=500 -StartLimitBurst=5 - -[Service] -Type=simple -ExecStart=/usr/local/bin/fwa --error -Restart=on-failure -RestartSec=5 -User=root -Group=root -WorkingDirectory=/var/lib/fwa -EnvironmentFile=/etc/fwa.env - -[Install] -WantedBy=multi-user.target diff --git a/service/fwa.env b/service/fwa.env deleted file mode 100644 index c85e0d3..0000000 --- a/service/fwa.env +++ /dev/null @@ -1,5 +0,0 @@ -PM3_BIN=/usr/share/pm3/pm3 -LOG_LEVEL=warn -HOTSPOT_IDS=578B5DF2;c1532b57 -HOTSPOT_SSID=fwa -HOTSPOT_PW=a9LG2kUVrsRRVUo1 diff --git a/service/fwa.service b/service/fwa.service deleted file mode 100644 index 8dfc998..0000000 --- a/service/fwa.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Feuerwehr Anwesenheit Service -Requires=local-fs.target -After=local-fs.target -StartLimitIntervalSec=500 -StartLimitBurst=5 -OnFailure= fwa-fail.service - -[Service] -Type=simple -ExecStart=/usr/local/bin/fwa -Restart=on-failure -RestartSec=5 -User=root -Group=root -WorkingDirectory=/var/lib/fwa -EnvironmentFile=/etc/fwa.env - -[Install] -WantedBy=multi-user.target diff --git a/src/bin/main.rs b/src/bin/main.rs new file mode 100644 index 0000000..6680689 --- /dev/null +++ b/src/bin/main.rs @@ -0,0 +1,275 @@ +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(impl_trait_in_assoc_type)] + +use core::net::Ipv4Addr; +use core::str::FromStr; + +use embassy_executor::Spawner; +use embassy_net::{Ipv4Cidr, Runner, Stack, StackResources, StaticConfigV4}; +use embassy_time::{Duration, Timer}; +use esp_hal::clock::CpuClock; +use esp_hal::gpio::{Output, OutputConfig}; +use esp_hal::peripherals::{GPIO1, GPIO2, UART1}; +use esp_hal::timer::systimer::SystemTimer; +use esp_hal::timer::timg::TimerGroup; +use esp_hal::uart::{Config, Uart}; +use esp_println::logger::init_logger; +use esp_wifi::wifi::{ + AccessPointConfiguration, Configuration, WifiController, WifiDevice, WifiEvent, WifiState, +}; +use log::{debug, info}; +use picoserve::routing::get; +use picoserve::{AppBuilder, AppRouter}; +use static_cell::make_static; + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { + loop {} +} + +extern crate alloc; + +#[esp_hal_embassy::main] +async fn main(spawner: Spawner) { + // ------------------- init --------------------------- + let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max()); + let peripherals = esp_hal::init(config); + + info!("starting up..."); + + esp_alloc::heap_allocator!(size: 72 * 1024); + + let timer0 = SystemTimer::new(peripherals.SYSTIMER); + esp_hal_embassy::init(timer0.alarm0); + + init_logger(log::LevelFilter::Debug); + + let timer1 = TimerGroup::new(peripherals.TIMG0); + let mut rng = esp_hal::rng::Rng::new(peripherals.RNG); + + debug!("set wlan antenna.."); + let mut rf_switch = Output::new( + peripherals.GPIO3, + esp_hal::gpio::Level::Low, + OutputConfig::default(), + ); + + rf_switch.set_low(); + + Timer::after_secs(1).await; + + let mut antenna_mode = Output::new( + peripherals.GPIO14, + esp_hal::gpio::Level::Low, + OutputConfig::default(), + ); + + antenna_mode.set_low(); + + Timer::after_secs(1).await; + + // Setup wifi deivce + debug!("setup wifi.."); + let esp_wifi_ctrl = + make_static!(esp_wifi::init(timer1.timer0, rng).unwrap()); + let (controller, interfaces) = esp_wifi::wifi::new(esp_wifi_ctrl, peripherals.WIFI).unwrap(); + // let wifi_interface = interfaces.sta; + let wifi_ap = interfaces.ap; + + let gw_ip_addr_str = "192.168.2.1"; + let gw_ip_addr = Ipv4Addr::from_str(gw_ip_addr_str).expect("failed to parse gateway ip"); + + let config = embassy_net::Config::ipv4_static(StaticConfigV4 { + address: Ipv4Cidr::new(gw_ip_addr, 24), + gateway: Some(gw_ip_addr), + dns_servers: Default::default(), + }); + + let seed = (rng.random() as u64) << 32 | rng.random() as u64; + + // Init network stack + let (stack, runner) = embassy_net::new( + wifi_ap, + config, + make_static!(StackResources::<3>::new()), + seed, + ); + + debug!("Setup complete. Running network tasks"); + + spawner.spawn(connection(controller)).ok(); + spawner.spawn(net_task(runner)).ok(); + spawner.spawn(run_dhcp(stack, gw_ip_addr_str)).ok(); + spawner + .spawn(rfid_reader_task( + peripherals.UART1, + peripherals.GPIO1, + peripherals.GPIO2, + )) + .ok(); + + loop { + if stack.is_link_up() { + break; + } + Timer::after(Duration::from_millis(500)).await; + if stack.is_config_up() { + break; + } + Timer::after(Duration::from_millis(500)).await; + } + + debug!("Starting webserver"); + + let app = make_static!(AppProps.build_app()); + + let config = make_static!(picoserve::Config::new(picoserve::Timeouts { + start_read_request: Some(Duration::from_secs(5)), + persistent_start_read_request: Some(Duration::from_secs(1)), + read_request: Some(Duration::from_secs(1)), + write: Some(Duration::from_secs(1)), + })); + + let _ = spawner.spawn(webserver_task(0, stack, app, config)); +} + +struct AppProps; + +impl AppBuilder for AppProps { + type PathRouter = impl picoserve::routing::PathRouter; + + fn build_app(self) -> picoserve::Router { + picoserve::Router::new().route("/", get(|| async move { "Hello World" })) + } +} + +#[embassy_executor::task] +async fn webserver_task( + id: usize, + stack: embassy_net::Stack<'static>, + app: &'static AppRouter, + config: &'static picoserve::Config, +) -> ! { + let mut tcp_rx_buffer = [0u8; 1024]; + let mut tcp_tx_buffer = [0u8; 1024]; + let mut http_buffer = [0u8; 2048]; + + picoserve::listen_and_serve( + id, + app, + config, + stack, + 80, + &mut tcp_rx_buffer, + &mut tcp_tx_buffer, + &mut http_buffer, + ) + .await +} + +#[embassy_executor::task] +async fn run_dhcp(stack: Stack<'static>, gw_ip_addr: &'static str) { + debug!("start dhcp"); + use core::net::{Ipv4Addr, SocketAddrV4}; + + use edge_dhcp::{ + io::{self, DEFAULT_SERVER_PORT}, + server::{Server, ServerOptions}, + }; + use edge_nal::UdpBind; + use edge_nal_embassy::{Udp, UdpBuffers}; + + let ip = Ipv4Addr::from_str(gw_ip_addr).expect("dhcp task failed to parse gw ip"); + + let mut buf = [0u8; 1500]; + + let mut gw_buf = [Ipv4Addr::UNSPECIFIED]; + + let buffers = UdpBuffers::<3, 1024, 1024, 10>::new(); + let unbound_socket = Udp::new(stack, &buffers); + let mut bound_socket = unbound_socket + .bind(core::net::SocketAddr::V4(SocketAddrV4::new( + Ipv4Addr::UNSPECIFIED, + DEFAULT_SERVER_PORT, + ))) + .await + .unwrap(); + + loop { + _ = io::server::run( + &mut Server::<_, 64>::new_with_et(ip), + &ServerOptions::new(ip, Some(&mut gw_buf)), + &mut bound_socket, + &mut buf, + ) + .await + .inspect_err(|e| log::warn!("DHCP server error: {e:?}")); + Timer::after(Duration::from_millis(500)).await; + } +} + +#[embassy_executor::task] +async fn net_task(mut runner: Runner<'static, WifiDevice<'static>>) { + runner.run().await; +} + +#[embassy_executor::task] +async fn connection(mut controller: WifiController<'static>) { + debug!("start connection task"); + debug!("Device capabilities: {:?}", controller.capabilities()); + loop { + match esp_wifi::wifi::wifi_state() { + WifiState::ApStarted => { + // wait until we're no longer connected + controller.wait_for_event(WifiEvent::ApStop).await; + Timer::after(Duration::from_millis(5000)).await + } + _ => {} + } + if !matches!(controller.is_started(), Ok(true)) { + let client_config = Configuration::AccessPoint(AccessPointConfiguration { + ssid: "esp-wifi".try_into().unwrap(), + ..Default::default() + }); + controller.set_configuration(&client_config).unwrap(); + debug!("Starting wifi"); + controller.start_async().await.unwrap(); + debug!("Wifi started!"); + } + } +} + +#[embassy_executor::task] +async fn rfid_reader_task(uart1: UART1<'static>, gpio1: GPIO1<'static>, gpio2: GPIO2<'static>) { + debug!("init rfid reader.."); + + let uart1_block_result = Uart::new(uart1, Config::default().with_baudrate(9600)); + let mut nfc_reader = match uart1_block_result { + Ok(block) => block.with_rx(gpio1).with_tx(gpio2).into_async(), + Err(e) => { + log::error!("Failed to initialize UART: {:?}", e); + return; + } + }; + + let mut uart_buffer = [0u8; 64]; + + loop { + debug!("Looking for NFC..."); + match nfc_reader.read_async(&mut uart_buffer).await { + Ok(n) => { + let mut hex_str = heapless::String::<128>::new(); + for byte in &uart_buffer[..n] { + core::fmt::Write::write_fmt(&mut hex_str, format_args!("{:02X} ", byte)).ok(); + } + info!("Read {} bytes from UART: {}", n, hex_str); + } + Err(e) => { + log::error!("Error reading from UART: {:?}", e); + } + } + Timer::after(Duration::from_millis(200)).await; + } +} diff --git a/src/hardware/gpio_buzzer.rs b/src/hardware/gpio_buzzer.rs deleted file mode 100644 index 7752f31..0000000 --- a/src/hardware/gpio_buzzer.rs +++ /dev/null @@ -1,37 +0,0 @@ -use anyhow::Result; -use rppal::pwm::{Channel, Polarity, Pwm}; -use std::time::Duration; -use tokio::time::sleep; - -use crate::hardware::Buzzer; - -const DEFAULT_PWM_CHANNEL_BUZZER: Channel = Channel::Pwm0; //PWM0 = GPIO18/Physical pin 12 - -pub struct GPIOBuzzer { - pwm: Pwm, -} - -impl GPIOBuzzer { - pub fn new_from_channel(channel: Channel) -> Result { - // Enable with dummy values; we'll set frequency/duty in the tone method - let duty_cycle: f64 = 0.5; - let pwm = Pwm::with_frequency(channel, 1000.0, duty_cycle, Polarity::Normal, true)?; - pwm.disable()?; - - Ok(GPIOBuzzer { pwm }) - } - - pub fn new_default() -> Result { - Self::new_from_channel(DEFAULT_PWM_CHANNEL_BUZZER) - } -} - -impl Buzzer for GPIOBuzzer { - async fn modulated_tone(&mut self, frequency_hz: f64, duration: Duration) -> Result<()> { - self.pwm.set_frequency(frequency_hz, 0.5)?; // 50% duty cycle (square wave) - self.pwm.enable()?; - sleep(duration).await; - self.pwm.disable()?; - Ok(()) - } -} diff --git a/src/hardware/hotspot.rs b/src/hardware/hotspot.rs deleted file mode 100644 index ec9cfc3..0000000 --- a/src/hardware/hotspot.rs +++ /dev/null @@ -1,131 +0,0 @@ -use anyhow::{Result, anyhow}; -use log::{trace, warn}; -use std::env; -use tokio::process::Command; - -use crate::hardware::Hotspot; - -const SSID: &str = "fwa"; -const CON_NAME: &str = "fwa-hotspot"; -const PASSWORD: &str = "a9LG2kUVrsRRVUo1"; -const IPV4_ADDRES: &str = "192.168.4.1/24"; - -/// NetworkManager Hotspot -pub struct NMHotspot { - ssid: String, - con_name: String, - password: String, - ipv4: String, -} - -impl NMHotspot { - pub fn new_from_env() -> Result { - let ssid = env::var("HOTSPOT_SSID").unwrap_or(SSID.to_owned()); - let password = env::var("HOTSPOT_PW").unwrap_or_else(|_| { - warn!("HOTSPOT_PW not set. Using default password"); - PASSWORD.to_owned() - }); - - if password.len() < 8 { - return Err(anyhow!("Hotspot password to short")); - } - - Ok(NMHotspot { - ssid, - con_name: CON_NAME.to_owned(), - password, - ipv4: IPV4_ADDRES.to_owned(), - }) - } - - async fn create_hotspot(&self) -> Result<()> { - let cmd = Command::new("nmcli") - .args(["device", "wifi", "hotspot"]) - .arg("con-name") - .arg(&self.con_name) - .arg("ssid") - .arg(&self.ssid) - .arg("password") - .arg(&self.password) - .output() - .await?; - - trace!("nmcli (std): {}", String::from_utf8_lossy(&cmd.stdout)); - trace!("nmcli (err): {}", String::from_utf8_lossy(&cmd.stderr)); - - if !cmd.status.success() { - return Err(anyhow!("nmcli command had non-zero exit code")); - } - - let cmd = Command::new("nmcli") - .arg("connection") - .arg("modify") - .arg(&self.con_name) - .arg("ipv4.method") - .arg("shared") - .arg("ipv4.addresses") - .arg(&self.ipv4) - .output() - .await?; - - if !cmd.status.success() { - return Err(anyhow!("nmcli command had non-zero exit code")); - } - - Ok(()) - } - - /// Checks if the connection already exists - async fn exists(&self) -> Result { - let cmd = Command::new("nmcli") - .args(["connection", "show"]) - .arg(&self.con_name) - .output() - .await?; - - trace!("nmcli (std): {}", String::from_utf8_lossy(&cmd.stdout)); - trace!("nmcli (err): {}", String::from_utf8_lossy(&cmd.stderr)); - - Ok(cmd.status.success()) - } -} - -impl Hotspot for NMHotspot { - async fn enable_hotspot(&self) -> Result<()> { - if !self.exists().await? { - self.create_hotspot().await?; - } - - let cmd = Command::new("nmcli") - .args(["connection", "up"]) - .arg(&self.con_name) - .output() - .await?; - - trace!("nmcli (std): {}", String::from_utf8_lossy(&cmd.stdout)); - trace!("nmcli (err): {}", String::from_utf8_lossy(&cmd.stderr)); - - if !cmd.status.success() { - return Err(anyhow!("nmcli command had non-zero exit code")); - } - - Ok(()) - } - - async fn disable_hotspot(&self) -> Result<()> { - let cmd = Command::new("nmcli") - .args(["connection", "down"]) - .arg(&self.con_name) - .output() - .await?; - - trace!("nmcli (std): {}", String::from_utf8_lossy(&cmd.stdout)); - trace!("nmcli (err): {}", String::from_utf8_lossy(&cmd.stderr)); - - if !cmd.status.success() { - return Err(anyhow!("nmcli command had non-zero exit code")); - } - - Ok(()) - } -} diff --git a/src/hardware/mod.rs b/src/hardware/mod.rs index 108d810..698e74c 100644 --- a/src/hardware/mod.rs +++ b/src/hardware/mod.rs @@ -24,22 +24,3 @@ pub trait Buzzer { ) -> impl Future> + std::marker::Send; } -pub trait Hotspot { - fn enable_hotspot(&self) -> impl std::future::Future> + std::marker::Send; - - fn disable_hotspot(&self) -> impl std::future::Future> + std::marker::Send; -} - -/// Create a struct to manage the hotspot -/// Respects the `mock_pi` flag. -pub fn create_hotspot() -> Result { - #[cfg(feature = "mock_pi")] - { - Ok(mock::MockHotspot {}) - } - - #[cfg(not(feature = "mock_pi"))] - { - hotspot::NMHotspot::new_from_env() - } -} diff --git a/src/hardware/spi_led.rs b/src/hardware/spi_led.rs deleted file mode 100644 index 4094690..0000000 --- a/src/hardware/spi_led.rs +++ /dev/null @@ -1,33 +0,0 @@ -use anyhow::Result; -use rppal::spi::{Bus, Mode, SlaveSelect, Spi}; -use smart_leds::SmartLedsWrite; -use ws2812_spi::Ws2812; - -use crate::hardware::StatusLed; - -const SPI_CLOCK_SPEED: u32 = 3_800_000; - -pub struct SpiLed { - controller: Ws2812, -} - -impl SpiLed { - pub fn new() -> Result { - let spi = Spi::new(Bus::Spi0, SlaveSelect::Ss0, SPI_CLOCK_SPEED, Mode::Mode0)?; - let controller = Ws2812::new(spi); - Ok(SpiLed { controller }) - } -} - -impl StatusLed for SpiLed { - fn turn_off(&mut self) -> Result<()> { - self.controller - .write(vec![rgb::RGB8::new(0, 0, 0)].into_iter())?; - Ok(()) - } - - fn turn_on(&mut self, color: rgb::RGB8) -> Result<()> { - self.controller.write(vec![color].into_iter())?; - Ok(()) - } -} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..0c9ac1a --- /dev/null +++ b/src/lib.rs @@ -0,0 +1 @@ +#![no_std] diff --git a/src/logger.rs b/src/logger.rs deleted file mode 100644 index c09aedd..0000000 --- a/src/logger.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::env; - -use log::LevelFilter; -use simplelog::{ConfigBuilder, SimpleLogger}; - -pub fn setup_logger() { - let log_level = env::var("LOG_LEVEL") - .ok() - .and_then(|level| level.parse::().ok()) - .unwrap_or({ - if cfg!(debug_assertions) { - LevelFilter::Debug - } else { - LevelFilter::Warn - } - }); - - let config = ConfigBuilder::new() - .set_target_level(LevelFilter::Off) - .set_location_level(LevelFilter::Off) - .set_thread_level(LevelFilter::Off) - .build(); - - let _ = SimpleLogger::init(log_level, config); -} diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 5d737a0..0000000 --- a/src/main.rs +++ /dev/null @@ -1,192 +0,0 @@ -#![allow(dead_code)] - -use anyhow::Result; -use feedback::{Feedback, FeedbackImpl}; -use log::{error, info, warn}; -use std::{ - env::{self, args}, - sync::Arc, - time::Duration, -}; -use tally_id::TallyID; -use tokio::{ - fs, - signal::unix::{SignalKind, signal}, - sync::{ - Mutex, - broadcast::{self, Receiver, Sender}, - }, - try_join, -}; -use webserver::start_webserver; - -use crate::{hardware::{create_hotspot, Hotspot}, pm3::run_pm3, store::IDStore, webserver::{spawn_idle_watcher, ActivityNotifier}}; - -mod feedback; -mod hardware; -mod pm3; -mod logger; -mod tally_id; -mod webserver; -mod store; - -const STORE_PATH: &str = "./data.json"; - -async fn run_webserver( - store: Arc>, - id_channel: Sender, - hotspot: Arc>, - user_feedback: Arc>, -) -> Result<()> -where - H: Hotspot + Send + Sync + 'static, -{ - let activity_channel = spawn_idle_watcher(Duration::from_secs(60 * 30), move || { - info!("No activity on webserver. Disabling hotspot"); - let cloned_hotspot = hotspot.clone(); - let cloned_user_feedback = user_feedback.clone(); - tokio::spawn(async move { - let _ = cloned_hotspot.lock().await.disable_hotspot().await; - cloned_user_feedback - .lock() - .await - .set_device_status(feedback::DeviceStatus::Ready); - }); - }); - - let notifier = ActivityNotifier { - sender: activity_channel, - }; - - start_webserver(store, id_channel, notifier).await?; - - Ok(()) -} - -async fn load_or_create_store() -> Result { - if fs::try_exists(STORE_PATH).await? { - info!("Loading data from file"); - IDStore::new_from_json(STORE_PATH).await - } else { - info!("No data file found. Creating empty one."); - Ok(IDStore::new()) - } -} - -fn get_hotspot_enable_ids() -> Vec { - let hotspot_ids: Vec = env::var("HOTSPOT_IDS") - .map(|ids| ids.split(";").map(|id| TallyID(id.to_owned())).collect()) - .unwrap_or_default(); - - if hotspot_ids.is_empty() { - warn!( - "HOTSPOT_IDS is not set or empty. You will not be able to activate the hotspot via a tally!" - ); - } - - hotspot_ids -} - -async fn handle_ids_loop( - mut id_channel: Receiver, - hotspot_enable_ids: Vec, - id_store: Arc>, - hotspot: Arc>, - user_feedback: Arc>, -) -> Result<()> { - while let Ok(tally_id_string) = id_channel.recv().await { - let tally_id = TallyID(tally_id_string); - - if hotspot_enable_ids.contains(&tally_id) { - info!("Enableing hotspot"); - let hotspot_enable_result = hotspot.lock().await.enable_hotspot().await; - - match hotspot_enable_result { - Ok(_) => { - user_feedback - .lock() - .await - .set_device_status(feedback::DeviceStatus::HotspotEnabled); - } - Err(e) => { - error!("Hotspot: {e}"); - } - } - - // TODO: Should the ID be added anyway or ignored ? - } - - if id_store.lock().await.add_id(tally_id) { - info!("Added new id to current day"); - - user_feedback.lock().await.success().await; - - if let Err(e) = id_store.lock().await.export_json(STORE_PATH).await { - error!("Failed to save id store to file: {e}"); - user_feedback.lock().await.failure().await; - // TODO: How to handle a failure to save ? - } - } - } - - Ok(()) -} - -async fn enter_error_state(feedback: Arc>, hotspot: Arc>) { - let _ = feedback.lock().await.activate_error_state().await; - let _ = hotspot.lock().await.enable_hotspot().await; - - let mut sigterm = signal(SignalKind::terminate()).unwrap(); - sigterm.recv().await; -} - -#[tokio::main] -async fn main() -> Result<()> { - logger::setup_logger(); - - info!("Starting application"); - - let user_feedback = Arc::new(Mutex::new(Feedback::new()?)); - let hotspot = Arc::new(Mutex::new(create_hotspot()?)); - - let error_flag_set = args().any(|e| e == "--error" || e == "-e"); - if error_flag_set { - error!("Error flag set. Entering error state"); - enter_error_state(user_feedback.clone(), hotspot).await; - return Ok(()); - } - - let store: Arc> = Arc::new(Mutex::new(load_or_create_store().await?)); - let hotspot_enable_ids = get_hotspot_enable_ids(); - - let (tx, rx) = broadcast::channel::(32); - let sse_tx = tx.clone(); - - let pm3_handle = run_pm3(tx); - - user_feedback.lock().await.startup().await; - - let loop_handle = handle_ids_loop( - rx, - hotspot_enable_ids, - store.clone(), - hotspot.clone(), - user_feedback.clone(), - ); - - let webserver_handle = run_webserver( - store.clone(), - sse_tx, - hotspot.clone(), - user_feedback.clone(), - ); - - let run_result = try_join!(pm3_handle, loop_handle, webserver_handle); - - if let Err(e) = run_result { - error!("Failed to run application: {e}"); - return Err(e); - } - - Ok(()) -} diff --git a/src/pm3/mod.rs b/src/pm3/mod.rs deleted file mode 100644 index 3d67335..0000000 --- a/src/pm3/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod runner; -mod parser; - -pub use runner::run_pm3; diff --git a/src/pm3/parser.rs b/src/pm3/parser.rs deleted file mode 100644 index e0a7b3c..0000000 --- a/src/pm3/parser.rs +++ /dev/null @@ -1,10 +0,0 @@ -use regex::Regex; - -/// Parses the output of PM3 finds the read IDs -/// Example input: `[+] UID.... 3112B710` -pub fn parse_line(line: &str) -> Option { - let regex = Regex::new(r"(?m)^\[\+\] UID.... (.*)$").unwrap(); - let result = regex.captures(line); - - result.map(|c| c.get(1).unwrap().as_str().to_owned()) -} diff --git a/src/pm3/runner.rs b/src/pm3/runner.rs deleted file mode 100644 index 2877a8c..0000000 --- a/src/pm3/runner.rs +++ /dev/null @@ -1,95 +0,0 @@ -use anyhow::{Result, anyhow}; -use log::{debug, info, trace, warn}; -use std::env; -use std::process::Stdio; -use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; -use tokio::process::Command; -use tokio::select; -use tokio::signal::unix::{SignalKind, signal}; -use tokio::sync::broadcast; - -/// Runs the pm3 binary and monitors it's output -/// The pm3 binary is ether set in the env var PM3_BIN or found in the path -/// The ouput is parsed and send via the `tx` channel -pub async fn run_pm3(tx: broadcast::Sender) -> Result<()> { - kill_orphans().await; - - let pm3_path = match env::var("PM3_BIN") { - Ok(path) => path, - Err(_) => { - info!("PM3_BIN not set. Using default value"); - "pm3".to_owned() - } - }; - - let mut cmd = Command::new("stdbuf") - .arg("-oL") - .arg(pm3_path) - .arg("-c") - .arg("lf hitag reader -@") - .stdout(Stdio::piped()) - .stderr(Stdio::null()) - .stdin(Stdio::piped()) - .spawn()?; - - let stdout = cmd.stdout.take().ok_or(anyhow!("Failed to get stdout"))?; - let mut stdin = cmd.stdin.take().ok_or(anyhow!("Failed to get stdin"))?; - - let mut reader = BufReader::new(stdout).lines(); - - let mut sigterm = signal(SignalKind::terminate())?; - - let child_handle = tokio::spawn(async move { - let mut last_id: String = "".to_owned(); - while let Some(line) = reader.next_line().await.unwrap_or(None) { - trace!("PM3: {line}"); - if let Some(uid) = super::parser::parse_line(&line) { - if last_id == uid { - let _ = tx.send(uid.clone()); - } - last_id = uid; - } - } - }); - - select! { - _ = child_handle => {} - _ = sigterm.recv() => { - debug!("Graceful shutdown of PM3"); - let _ = stdin.write_all(b"\n").await; - let _ = stdin.flush().await; - } - }; - - let status = cmd.wait().await?; - - // We use the exit code here because status.success() is false if the child was terminated by a - // signal - let code = status.code().unwrap_or(0); - - if code == 0 { - Ok(()) - } else { - Err(anyhow!("PM3 exited with a non-zero exit code: {code}")) - } -} - -/// Kills any open pm3 instances -/// Also funny name. hehehe. -async fn kill_orphans() { - let kill_result = Command::new("pkill") - .arg("-KILL") - .arg("-x") - .arg("proxmark3") - .output() - .await; - - match kill_result { - Ok(_) => { - debug!("Successfully killed orphaned pm3 instances"); - } - Err(e) => { - warn!("Failed to kill pm3 orphans: {e} Continuing anyway"); - } - } -} diff --git a/src/webserver/activity_fairing.rs b/src/webserver/activity_fairing.rs deleted file mode 100644 index ceeb4ce..0000000 --- a/src/webserver/activity_fairing.rs +++ /dev/null @@ -1,46 +0,0 @@ -use std::time::Duration; - -use log::error; -use rocket::{ - Data, Request, - fairing::{Fairing, Info, Kind}, -}; -use tokio::{sync::mpsc, time::timeout}; - -pub struct ActivityNotifier { - pub sender: mpsc::Sender<()>, -} - -#[rocket::async_trait] -impl Fairing for ActivityNotifier { - fn info(&self) -> Info { - Info { - name: "Keeps track of time since the last request", - kind: Kind::Request | Kind::Response, - } - } - - async fn on_request(&self, _: &mut Request<'_>, _: &mut Data<'_>) { - error!("on_request"); - let _ = self.sender.try_send(()); - } -} - -pub fn spawn_idle_watcher(idle_duration: Duration, mut on_idle: F) -> mpsc::Sender<()> -where - F: FnMut() + Send + 'static, -{ - let (tx, mut rx) = mpsc::channel::<()>(100); - - tokio::spawn(async move { - loop { - let idle = timeout(idle_duration, rx.recv()).await; - if idle.is_err() { - // No activity received in the duration - on_idle(); - } - } - }); - - tx -} diff --git a/src/webserver/mod.rs b/src/webserver/mod.rs deleted file mode 100644 index e1d4290..0000000 --- a/src/webserver/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod server; -mod activity_fairing; - -pub use activity_fairing::{ActivityNotifier,spawn_idle_watcher}; -pub use server::start_webserver; - diff --git a/src/webserver/server.rs b/src/webserver/server.rs deleted file mode 100644 index a1bd1fa..0000000 --- a/src/webserver/server.rs +++ /dev/null @@ -1,142 +0,0 @@ -use log::{error, info, warn}; -use rocket::http::Status; -use rocket::response::stream::{Event, EventStream}; -use rocket::serde::json::Json; -use rocket::{Config, Shutdown, State, post}; -use rocket::{get, http::ContentType, response::content::RawHtml, routes}; -use rust_embed::Embed; -use serde::Deserialize; -use std::borrow::Cow; -use std::env; -use std::ffi::OsStr; -use std::sync::Arc; -use tokio::select; -use tokio::sync::Mutex; -use tokio::sync::broadcast::Sender; - -use crate::store::{IDMapping, IDStore, Name}; -use crate::tally_id::TallyID; -use crate::webserver::ActivityNotifier; - -#[derive(Embed)] -#[folder = "web/dist"] -struct Asset; - -#[derive(Deserialize)] -struct NewMapping { - id: String, - name: Name, -} - -pub async fn start_webserver( - store: Arc>, - sse_broadcaster: Sender, - fairing: ActivityNotifier, -) -> Result<(), rocket::Error> { - let port = match env::var("HTTP_PORT") { - Ok(port) => port.parse().unwrap_or_else(|_| { - warn!("Failed to parse HTTP_PORT. Using default 80"); - 80 - }), - Err(_) => 80, - }; - - let config = Config { - address: "0.0.0.0".parse().unwrap(), // Listen on all interfaces - port, - ..Config::default() - }; - - rocket::custom(config) - .attach(fairing) - .mount( - "/", - routes![ - static_files, - index, - export_csv, - id_event, - get_mapping, - add_mapping - ], - ) - .manage(store) - .manage(sse_broadcaster) - .launch() - .await?; - Ok(()) -} - -#[get("/")] -fn index() -> Option>> { - let asset = Asset::get("index.html")?; - Some(RawHtml(asset.data)) -} - -#[get("/")] -fn static_files(file: std::path::PathBuf) -> Option<(ContentType, Vec)> { - let filename = file.display().to_string(); - let asset = Asset::get(&filename)?; - let content_type = file - .extension() - .and_then(OsStr::to_str) - .and_then(ContentType::from_extension) - .unwrap_or(ContentType::Bytes); - - Some((content_type, asset.data.into_owned())) -} - -#[get("/api/idevent")] -fn id_event(sse_broadcaster: &State>, shutdown: Shutdown) -> EventStream![] { - let mut rx = sse_broadcaster.subscribe(); - EventStream! { - loop { - select! { - msg = rx.recv() => { - if let Ok(id) = msg { - yield Event::data(id); - } - } - _ = &mut shutdown.clone() => { - // Shutdown signal received, exit the loop - break; - } - } - } - } -} - -#[get("/api/csv")] -async fn export_csv(manager: &State>>) -> Result { - info!("Exporting CSV"); - match manager.lock().await.export_csv() { - Ok(csv) => Ok(csv), - Err(e) => { - error!("Failed to generate csv: {e}"); - Err(Status::InternalServerError) - } - } -} - -#[get("/api/mapping")] -async fn get_mapping(store: &State>>) -> Json { - Json(store.lock().await.mapping.clone()) -} - -#[post("/api/mapping", format = "json", data = "")] -async fn add_mapping(store: &State>>, new_mapping: Json) -> Status { - if new_mapping.id.is_empty() - || new_mapping.name.first.is_empty() - || new_mapping.name.last.is_empty() - { - return Status::BadRequest; - } - - store - .lock() - .await - .mapping - .add_mapping(TallyID(new_mapping.id.clone()), new_mapping.name.clone()); - - Status::Created -}