diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 032e762..6e3eec5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: toolchain: - stable # msrv - - 1.70.0 + - 1.74.0 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 05fb44f..d19d7eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + +## [v0.8.0] 2024-09-02 +- Update MSRV to `1.74` to [!130](https://github.com/rsadsb/dump1090_rs/pull/130) +- Properly decode short ADSB messages, thanks [@gariac](https://github.com/gariac) for finding. [!130](https://github.com/rsadsb/dump1090_rs/pull/130) +- Add `--quiet` to remove hex output of decoded message bytes [!130](https://github.com/rsadsb/dump1090_rs/pull/130) + ## [v0.7.1] 2024-02-10 - Add `--driver-extra` to specify additional sopaysdr device options [!108](https://github.com/rsadsb/dump1090_rs/pull/108) diff --git a/Cargo.lock b/Cargo.lock index d6e927f..daa735a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "anes" version = "0.1.6" @@ -10,50 +19,51 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -64,9 +74,9 @@ checksum = "f7010f1430f0fc8ca80bdb5e5d074db68776a2e268ec6cf80b53712d3ea4bca7" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bindgen" @@ -90,15 +100,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.3.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -114,9 +124,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +dependencies = [ + "shlex", +] [[package]] name = "cexpr" @@ -135,9 +148,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -146,15 +159,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -162,9 +175,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -173,9 +186,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -183,9 +196,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -196,9 +209,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", @@ -208,15 +221,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "criterion" @@ -254,52 +267,40 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "dump1090_rs" -version = "0.7.1" +version = "0.8.0" dependencies = [ "clap", "hex", @@ -312,9 +313,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -324,23 +325,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -351,27 +341,31 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" -version = "1.8.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -387,9 +381,9 @@ checksum = "5b6e75c860d4216ac53f9ac88b25c99eaedba075b3a7b2ed31f2adc51a74fffd" [[package]] name = "indexmap" -version = "2.1.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -397,15 +391,21 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ "hermit-abi", - "rustix", - "windows-sys", + "libc", + "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -417,24 +417,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.7" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aa48fab2893d8a49caa94082ae8488f4e1050d73b367881dcd2198f4199fd8" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -444,13 +444,13 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libdump1090_rs" -version = "0.7.1" +version = "0.8.0" dependencies = [ "assert_hex", "byteorder", @@ -461,40 +461,31 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.6", ] [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" @@ -514,43 +505,33 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "peeking_take_while" @@ -560,15 +541,15 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -579,42 +560,42 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -622,30 +603,42 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustc-hash" @@ -655,22 +648,22 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.2" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabcb0461ebd01d6b79945797c27f8529082226cb630a9865a71870ff63532a4" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -681,26 +674,20 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "serde" -version = "1.0.197" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -709,29 +696,30 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "soapysdr" @@ -757,15 +745,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.50" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -779,7 +767,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -794,9 +782,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -806,18 +794,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", @@ -828,21 +816,21 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -850,19 +838,20 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -875,9 +864,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -885,9 +874,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -898,122 +887,182 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "winapi-util" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-sys 0.59.0", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] [[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "winapi", + "windows-targets 0.52.6", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows-targets", + "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", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "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", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +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 = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +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 = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +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" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +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.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +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.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +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.0" +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" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.18" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index e8f8b1a..75773cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,8 @@ rust-version.workspace = true [workspace.package] edition = "2021" -version = "0.7.1" -rust-version = "1.70.0" +version = "0.8.0" +rust-version = "1.74.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index 829e913..a7e9f71 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you have tested this project on devices not listed below, let me know! ## Usage -**Minimum Supported Rust Version**: 1.70.0 +**Minimum Supported Rust Version**: 1.74.0 ## Build diff --git a/benches/demod_benchmark.rs b/benches/demod_benchmark.rs index 2d3405c..57c5182 100644 --- a/benches/demod_benchmark.rs +++ b/benches/demod_benchmark.rs @@ -3,43 +3,50 @@ use assert_hex::assert_eq_hex; use criterion::{criterion_group, criterion_main, Criterion}; use hexlit::hex; // crate -use libdump1090_rs::utils; +use libdump1090_rs::{demod_2400::demodulate2400, icao_filter::icao_flush, utils}; use num_complex::Complex; -fn routine(data: [Complex; 0x20000], expected_data: &Vec<[u8; 14]>) { +fn routine(data: [Complex; 0x20000], expected_data: &Vec>) { + // make sure icao starts in a deterministic position + icao_flush(); let outbuf = utils::to_mag(&data); - let data = libdump1090_rs::demod_2400::demodulate2400(&outbuf).unwrap(); - assert_eq_hex!(expected_data, &*data); + let data = demodulate2400(&outbuf).unwrap(); + for (a, b) in data.iter().zip(expected_data.iter()) { + assert_eq_hex!(a.buffer(), *b); + } } fn criterion_benchmark(c: &mut Criterion) { let filename = "test_iq/test_1641427457780.iq"; let data_01 = utils::read_test_data(filename); let expected_data_01 = Vec::from([ - hex!("8dad929358b9c6273f002169c02e"), - hex!("8daa2bc4f82100020049b8db9449"), - hex!("8daa2bc4f82100020049b8db9449"), - hex!("8da0aaa058bf163fcf860013e840"), + hex!("8dad929358b9c6273f002169c02e").to_vec(), + hex!("8daa2bc4f82100020049b8db9449").to_vec(), + hex!("8daa2bc4f82100020049b8db9449").to_vec(), + hex!("02e1971ce17c84").to_vec(), + hex!("8da0aaa058bf163fcf860013e840").to_vec(), ]); let filename = "test_iq/test_1641428165033.iq"; let data_02 = utils::read_test_data(filename); let expected_data_02 = Vec::from([ - hex!("8da79de99909932f780c9e2f2f8f"), - hex!("8dac04d358a7820a86ac3709e689"), - hex!("8dac04d3ea4288669b5c082751d4"), - hex!("8da79de958bdf59c85104874adad"), - hex!("5dad92936265f525be017735997b"), + hex!("8da79de99909932f780c9e2f2f8f").to_vec(), + hex!("8dac04d358a7820a86ac3709e689").to_vec(), + hex!("8dac04d3ea4288669b5c082751d4").to_vec(), + hex!("8da79de958bdf59c85104874adad").to_vec(), + hex!("5dad92936265f5").to_vec(), + hex!("5dad92936265f525be017735997b").to_vec(), ]); let filename = "test_iq/test_1641428106243.iq"; let data_03 = utils::read_test_data(filename); let expected_data_03 = Vec::from([ - hex!("8da8aac8990c30b51808aa24e573"), - hex!("8dada6b9990cf61e4848af2a8656"), - hex!("8da4ba025885462008fa0a4a6eb2"), - hex!("8da4ba025885462008fa0a4a6eb2"), - hex!("8da4ba0299115f301074a72db6ff"), + hex!("8da8aac8990c30b51808aa24e573").to_vec(), + hex!("02e19838bff1d9").to_vec(), + hex!("8dada6b9990cf61e4848af2a8656").to_vec(), + hex!("8da4ba025885462008fa0a4a6eb2").to_vec(), + hex!("8da4ba025885462008fa0a4a6eb2").to_vec(), + hex!("8da4ba0299115f301074a72db6ff").to_vec(), ]); c.bench_function("01", |b| b.iter(|| routine(data_01, &expected_data_01))); c.bench_function("02", |b| b.iter(|| routine(data_02, &expected_data_02))); diff --git a/dump1090_rs/Cargo.toml b/dump1090_rs/Cargo.toml index c6c31a1..eeb3d28 100644 --- a/dump1090_rs/Cargo.toml +++ b/dump1090_rs/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true clap = {version = "4.4.8", features = ["color", "derive", "wrap_help"]} num-complex = "0.4.4" soapysdr = "0.4.0" -libdump1090_rs = { path = "../", version = "0.7.0" } +libdump1090_rs = { path = "../", version = "0.8.0" } hex = "0.4.0" toml = "0.8.8" serde = { version = "1.0.197", features = ["derive"] } diff --git a/dump1090_rs/src/main.rs b/dump1090_rs/src/main.rs index 44b11db..4b1a2a0 100644 --- a/dump1090_rs/src/main.rs +++ b/dump1090_rs/src/main.rs @@ -4,6 +4,7 @@ use std::io::Write; use std::net::{IpAddr, TcpListener}; use clap::Parser; +use libdump1090_rs::demod_2400::demodulate2400; use libdump1090_rs::utils; use num_complex::Complex; use sdrconfig::{SdrConfig, DEFAULT_CONFIG}; @@ -59,6 +60,10 @@ struct Options { #[clap(long, help = CUSTOM_CONFIG_HELP, long_help = CUSTOM_CONFIG_LONG_HELP)] custom_config: Option, + + /// don't display hex output of messages + #[clap(long)] + quiet: bool, } // main will exit as 0 for success, 1 on error @@ -159,16 +164,19 @@ fn main() { // demodulate new data let buf = &buf[..len]; let outbuf = utils::to_mag(buf); - let resulting_data = libdump1090_rs::demod_2400::demodulate2400(&outbuf).unwrap(); + let resulting_data = demodulate2400(&outbuf).unwrap(); // send new data to connected clients if !resulting_data.is_empty() { let resulting_data: Vec = resulting_data .iter() .map(|a| { - let a = hex::encode(a); - let a = format!("*{a};\n"); - println!("{}", &a[..a.len() - 1]); + let msg = a.buffer(); + let h = hex::encode(msg); + let a = format!("*{h};\n"); + if !options.quiet { + println!("{}", &a[..a.len() - 1]); + } a }) .collect(); diff --git a/src/demod_2400.rs b/src/demod_2400.rs index fce79da..17a4c41 100644 --- a/src/demod_2400.rs +++ b/src/demod_2400.rs @@ -1,6 +1,8 @@ // This module includes functionality translated from demod_2400.c -use crate::{mode_s, MagnitudeBuffer, MODES_LONG_MSG_BYTES}; +use crate::{ + mode_s::score_modes_message, MagnitudeBuffer, MODES_LONG_MSG_BYTES, MODES_SHORT_MSG_BYTES, +}; #[derive(Clone, Copy, Debug)] enum Phase { @@ -77,7 +79,34 @@ impl Phase { } } -pub fn demodulate2400(mag: &MagnitudeBuffer) -> Result, &'static str> { +#[derive(Debug, PartialEq, Eq)] +pub enum MsgLen { + Short, + Long, +} + +#[derive(Debug)] +pub struct ModeSMessage { + /// Type of message + msglen: MsgLen, + /// Binary message + msg: [u8; MODES_LONG_MSG_BYTES], + /// RSSI, in the range [0..1], as a fraction of full-scale power + signal_level: f64, + /// Scoring from scoreModesMessage, if used + score: i32, +} + +impl ModeSMessage { + pub fn buffer(&self) -> &[u8] { + match self.msglen { + MsgLen::Short => &self.msg[..MODES_SHORT_MSG_BYTES], + MsgLen::Long => &self.msg[..MODES_LONG_MSG_BYTES], + } + } +} + +pub fn demodulate2400(mag: &MagnitudeBuffer) -> Result, &'static str> { let mut results = vec![]; let data = &mag.data; @@ -111,10 +140,15 @@ pub fn demodulate2400(mag: &MagnitudeBuffer) -> Result, &'static s } // Try all phases - let mut bestmsg: [u8; MODES_LONG_MSG_BYTES] = [0_u8; MODES_LONG_MSG_BYTES]; - let mut bestscore: i32 = -2; + let mut bestmsg = ModeSMessage { + msg: [0_u8; MODES_LONG_MSG_BYTES], + signal_level: 0., + score: -2, + msglen: MsgLen::Short, + }; let mut msg: [u8; MODES_LONG_MSG_BYTES] = [0_u8; MODES_LONG_MSG_BYTES]; + for try_phase in 4..9 { let mut slice_loc: usize = j + 19 + (try_phase / 5); let mut phase = Phase::from(try_phase); @@ -141,18 +175,29 @@ pub fn demodulate2400(mag: &MagnitudeBuffer) -> Result, &'static s phase = starting_phase.next_start(); } - let score = mode_s::score_modes_message(&msg); + if let Some((msglen, score)) = score_modes_message(&msg) { + if score > bestmsg.score { + bestmsg.msglen = msglen; + bestmsg.msg.clone_from_slice(&msg); + bestmsg.score = score; - if score > bestscore { - bestmsg.clone_from_slice(&msg); - bestscore = score; + let mut scaled_signal_power = 0_u64; + let signal_len = msg.len() * 12 / 5; + for k in 0..signal_len { + let mag = data[j + 19 + k] as u64; + scaled_signal_power += mag * mag; + } + let signal_power = scaled_signal_power as f64 / 65535.0 / 65535.0; + bestmsg.signal_level = signal_power / signal_len as f64; + } } } // Do we have a candidate? - if bestscore < 0 { + if bestmsg.score < 0 { continue 'jloop; } + results.push(bestmsg); } } diff --git a/src/icao_filter.rs b/src/icao_filter.rs index a5a5b51..0f49546 100644 --- a/src/icao_filter.rs +++ b/src/icao_filter.rs @@ -3,10 +3,19 @@ use std::sync::Mutex; const ICAO_FILTER_SIZE: u32 = 4096; +pub const ICAO_FILTER_ADSB_NT: u32 = 1 << 25; static ICAO_FILTER_A: Mutex<[u32; 4096]> = Mutex::new([0; 4096]); static ICAO_FILTER_B: Mutex<[u32; 4096]> = Mutex::new([0; 4096]); +pub fn icao_flush() { + let mut i = ICAO_FILTER_A.lock().unwrap(); + *i = [0; 4096]; + + let mut i = ICAO_FILTER_B.lock().unwrap(); + *i = [0; 4096]; +} + pub fn icao_hash(a32: u32) -> u32 // icao_filter.c:38 { let a: u64 = u64::from(a32); @@ -33,11 +42,30 @@ pub fn icao_hash(a32: u32) -> u32 // icao_filter.c:38 (hash as u32) & (ICAO_FILTER_SIZE - 1) } +// The original function uses a integer return value, but it's used as a boolean +pub fn icao_filter_add(addr: u32) { + let mut h: u32 = icao_hash(addr); + let h0: u32 = h; + if let Ok(mut icao_filter_a) = ICAO_FILTER_A.lock() { + while (icao_filter_a[h as usize] != 0) && (icao_filter_a[h as usize] != addr) { + h = (h + 1) & (ICAO_FILTER_SIZE - 1); + if h == h0 { + eprintln!("icao24 hash table full"); + return; + } + } + + if icao_filter_a[h as usize] == 0 { + icao_filter_a[h as usize] = addr; + } + } +} + // The original function uses a integer return value, but it's used as a boolean pub fn icao_filter_test(addr: u32) -> bool // icao_filter.c:96 { let mut h: u32 = icao_hash(addr); - let h0: u32 = icao_hash(addr); + let h0: u32 = h; if let (Ok(icao_filter_a), Ok(icao_filter_b)) = (ICAO_FILTER_A.lock(), ICAO_FILTER_B.lock()) { 'loop_a: while (icao_filter_a[h as usize] != 0) && (icao_filter_a[h as usize] != addr) { diff --git a/src/lib.rs b/src/lib.rs index 33fc2bf..bfd6dea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,14 +16,14 @@ pub mod utils; // private mod crc; -mod icao_filter; +pub mod icao_filter; mod mode_s; pub const MODES_MAG_BUF_SAMPLES: usize = 131_072; const TRAILING_SAMPLES: usize = 326; -const MODES_LONG_MSG_BYTES: usize = 14; -const MODES_SHORT_MSG_BYTES: usize = 7; +pub const MODES_LONG_MSG_BYTES: usize = 14; +pub const MODES_SHORT_MSG_BYTES: usize = 7; // dump1090.h:252 #[derive(Copy, Clone, Debug)] diff --git a/src/mode_s/mod.rs b/src/mode_s/mod.rs index 7f30d97..0b58f4a 100644 --- a/src/mode_s/mod.rs +++ b/src/mode_s/mod.rs @@ -1,6 +1,12 @@ // This module includes functionality translated from mode_s.c -use crate::{MODES_LONG_MSG_BYTES, MODES_SHORT_MSG_BYTES}; +use crate::{ + demod_2400::MsgLen, + icao_filter::{icao_filter_add, ICAO_FILTER_ADSB_NT}, + MODES_LONG_MSG_BYTES, MODES_SHORT_MSG_BYTES, +}; + +use super::{crc::modes_checksum, icao_filter::icao_filter_test}; // mode_s.c:215 #[must_use] @@ -24,28 +30,29 @@ pub fn getbits(data: &[u8], firstbit_1idx: usize, lastbit_1idx: usize) -> usize // mode_s.c:289 #[must_use] -pub fn score_modes_message(msg: &[u8]) -> i32 { +pub fn score_modes_message(msg: &[u8]) -> Option<(MsgLen, i32)> { let validbits = msg.len() * 8; if validbits < 56 { - return -2; + return None; } - let msgtype = getbits(msg, 1, 5); - let msgbits = - if (msgtype & 0x10) != 0 { MODES_LONG_MSG_BYTES * 8 } else { MODES_SHORT_MSG_BYTES * 8 }; + let df = getbits(msg, 1, 5); + let (msgbits, msglen) = if (df & 0x10) != 0 { + (MODES_LONG_MSG_BYTES * 8, MsgLen::Long) + } else { + (MODES_SHORT_MSG_BYTES * 8, MsgLen::Short) + }; if validbits < msgbits { - return -2; + return None; } if msg.iter().all(|b| *b == 0x00) { - return -2; + return None; } - let crc = super::crc::modes_checksum(msg, msgbits); - - match msgtype { - 0 | 4 | 5 | 16 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 => { + let res = match df { + 0 | 4 | 5 => { // 0: short air-air surveillance // 4: surveillance, altitude reply // 5: surveillance, altitude reply @@ -59,7 +66,8 @@ pub fn score_modes_message(msg: &[u8]) -> i32 { // 30: Comm-D (ELM) // 31: Comm-D (ELM) - if super::icao_filter::icao_filter_test(crc) { + let crc = modes_checksum(msg, msgbits); + if icao_filter_test(crc) { 1000 } else { -1 @@ -67,13 +75,17 @@ pub fn score_modes_message(msg: &[u8]) -> i32 { } 11 => { // 11: All-call reply + let crc = modes_checksum(msg, msgbits); let iid = crc & 0x7f; let crc = crc & 0x00ff_ff80; let addr = getbits(msg, 9, 32) as u32; - match (crc, iid, super::icao_filter::icao_filter_test(addr)) { + match (crc, iid, icao_filter_test(addr)) { (0, 0, true) => 1600, - (0, 0, false) => 750, + (0, 0, false) => { + icao_filter_add(addr); + 750 + } (0, _, true) => 1000, (0, _, false) => -1, (_, _, _) => -2, @@ -84,20 +96,47 @@ pub fn score_modes_message(msg: &[u8]) -> i32 { // 18: Extended squitter/non-transponder let addr = getbits(msg, 9, 32) as u32; - match (crc, super::icao_filter::icao_filter_test(addr)) { + let crc = modes_checksum(msg, msgbits); + match (crc, icao_filter_test(addr)) { (0, true) => 1800, - (0, false) => 1400, + (0, false) => { + if df == 17 { + icao_filter_add(addr); + } else { + icao_filter_add(addr | ICAO_FILTER_ADSB_NT); + } + 1400 + } (_, _) => -2, } } - 20 | 21 => { + 16 | 20 | 21 => { + // 16: long air-air surveillance // 20: Comm-B, altitude reply // 21: Comm-B, identity reply - match super::icao_filter::icao_filter_test(crc) { + let crc = modes_checksum(msg, MODES_LONG_MSG_BYTES * 8); + match icao_filter_test(crc) { + true => 1000, + false => -2, + } + } + 24..=31 => { + // 24: Comm-D (ELM) + // 25: Comm-D (ELM) + // 26: Comm-D (ELM) + // 27: Comm-D (ELM) + // 28: Comm-D (ELM) + // 29: Comm-D (ELM) + // 30: Comm-D (ELM) + // 31: Comm-D (ELM) + let crc = modes_checksum(msg, MODES_LONG_MSG_BYTES * 8); + match icao_filter_test(crc) { true => 1000, false => -2, } } _ => -2, - } + }; + + Some((msglen, res)) } diff --git a/tests/test.rs b/tests/test.rs index 11263e6..0d6c31a 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -2,24 +2,29 @@ use assert_hex::assert_eq_hex; use hexlit::hex; // crate -use libdump1090_rs::utils; +use libdump1090_rs::{demod_2400::demodulate2400, icao_filter::icao_flush, utils}; -fn routine(filename: &str, expected_data: &[[u8; 14]]) { +fn routine(filename: &str, expected_data: &Vec>) { + // make sure icao starts in a deterministic position + icao_flush(); let buf = utils::read_test_data(filename); let outbuf = utils::to_mag(&buf); - let data = libdump1090_rs::demod_2400::demodulate2400(&outbuf).unwrap(); - assert_eq_hex!(expected_data, &*data); + let data = demodulate2400(&outbuf).unwrap(); + for (a, b) in data.iter().zip(expected_data.iter()) { + assert_eq_hex!(a.buffer(), *b); + } } #[test] fn test_01() { let filename = "test_iq/test_1641427457780.iq"; let expected_data = Vec::from([ - hex!("8dad929358b9c6273f002169c02e"), - hex!("8daa2bc4f82100020049b8db9449"), - hex!("8daa2bc4f82100020049b8db9449"), - hex!("8da0aaa058bf163fcf860013e840"), + hex!("8dad929358b9c6273f002169c02e").to_vec(), + hex!("8daa2bc4f82100020049b8db9449").to_vec(), + hex!("8daa2bc4f82100020049b8db9449").to_vec(), + hex!("02e1971ce17c84").to_vec(), + hex!("8da0aaa058bf163fcf860013e840").to_vec(), ]); routine(filename, &expected_data); } @@ -28,11 +33,12 @@ fn test_01() { fn test_02() { let filename = "test_iq/test_1641428165033.iq"; let expected_data = Vec::from([ - hex!("8da79de99909932f780c9e2f2f8f"), - hex!("8dac04d358a7820a86ac3709e689"), - hex!("8dac04d3ea4288669b5c082751d4"), - hex!("8da79de958bdf59c85104874adad"), - hex!("5dad92936265f525be017735997b"), + hex!("8da79de99909932f780c9e2f2f8f").to_vec(), + hex!("8dac04d358a7820a86ac3709e689").to_vec(), + hex!("8dac04d3ea4288669b5c082751d4").to_vec(), + hex!("8da79de958bdf59c85104874adad").to_vec(), + hex!("5dad92936265f5").to_vec(), + hex!("5dad92936265f525be017735997b").to_vec(), ]); routine(filename, &expected_data); } @@ -41,11 +47,12 @@ fn test_02() { fn test_03() { let filename = "test_iq/test_1641428106243.iq"; let expected_data = Vec::from([ - hex!("8da8aac8990c30b51808aa24e573"), - hex!("8dada6b9990cf61e4848af2a8656"), - hex!("8da4ba025885462008fa0a4a6eb2"), - hex!("8da4ba025885462008fa0a4a6eb2"), - hex!("8da4ba0299115f301074a72db6ff"), + hex!("8da8aac8990c30b51808aa24e573").to_vec(), + hex!("02e19838bff1d9").to_vec(), + hex!("8dada6b9990cf61e4848af2a8656").to_vec(), + hex!("8da4ba025885462008fa0a4a6eb2").to_vec(), + hex!("8da4ba025885462008fa0a4a6eb2").to_vec(), + hex!("8da4ba0299115f301074a72db6ff").to_vec(), ]); routine(filename, &expected_data);