PUS Event Generation #17
250
Cargo.lock
generated
250
Cargo.lock
generated
@ -81,9 +81,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.11.0"
|
version = "3.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
|
checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bus"
|
name = "bus"
|
||||||
@ -102,6 +102,12 @@ version = "1.4.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@ -126,6 +132,16 @@ version = "0.2.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15"
|
checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "codespan-reporting"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
|
||||||
|
dependencies = [
|
||||||
|
"termcolor",
|
||||||
|
"unicode-width",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.3"
|
version = "0.8.3"
|
||||||
@ -183,12 +199,55 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-utils"
|
name = "crossbeam-utils"
|
||||||
version = "0.8.11"
|
version = "0.8.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
|
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cxx"
|
||||||
|
version = "1.0.80"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"cxxbridge-flags",
|
||||||
|
"cxxbridge-macro",
|
||||||
|
"link-cplusplus",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cxx-build"
|
||||||
|
version = "1.0.80"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"codespan-reporting",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"scratch",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cxxbridge-flags"
|
||||||
|
version = "1.0.80"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cxxbridge-macro"
|
||||||
|
version = "1.0.80"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -238,6 +297,7 @@ dependencies = [
|
|||||||
"delegate 0.8.0",
|
"delegate 0.8.0",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
"heapless",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"postcard",
|
"postcard",
|
||||||
@ -254,13 +314,14 @@ dependencies = [
|
|||||||
"delegate 0.8.0",
|
"delegate 0.8.0",
|
||||||
"fsrc-core",
|
"fsrc-core",
|
||||||
"spacepackets",
|
"spacepackets",
|
||||||
|
"zerocopy",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.7"
|
version = "0.2.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
|
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
@ -310,23 +371,33 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iana-time-zone"
|
name = "iana-time-zone"
|
||||||
version = "0.1.47"
|
version = "0.1.51"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7"
|
checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
|
"iana-time-zone-haiku",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"once_cell",
|
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "iana-time-zone-haiku"
|
||||||
version = "0.3.59"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
|
checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca"
|
||||||
|
dependencies = [
|
||||||
|
"cxx",
|
||||||
|
"cxx-build",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.60"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
@ -339,15 +410,24 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.132"
|
version = "0.2.135"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
|
checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "link-cplusplus"
|
||||||
|
version = "1.0.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.4.8"
|
version = "0.4.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390"
|
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"scopeguard",
|
"scopeguard",
|
||||||
@ -414,15 +494,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.14.0"
|
version = "1.15.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0"
|
checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.9.3"
|
version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
|
checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
@ -444,9 +524,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.43"
|
version = "1.0.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
|
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@ -522,7 +602,7 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"semver 1.0.13",
|
"semver 1.0.14",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -531,6 +611,12 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scratch"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
@ -542,9 +628,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.13"
|
version = "1.0.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711"
|
checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver-parser"
|
name = "semver-parser"
|
||||||
@ -554,18 +640,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.144"
|
version = "1.0.147"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
|
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.144"
|
version = "1.0.147"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
|
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -574,13 +660,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
version = "1.9.0"
|
version = "1.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
|
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spacepackets"
|
name = "spacepackets"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crc",
|
"crc",
|
||||||
@ -608,9 +694,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.99"
|
version = "1.0.103"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
|
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -618,28 +704,25 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "synstructure"
|
name = "termcolor"
|
||||||
version = "0.12.6"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
|
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"winapi-util",
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
"unicode-xid",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.3"
|
version = "1.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
|
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-width"
|
||||||
version = "0.2.3"
|
version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04"
|
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vcell"
|
name = "vcell"
|
||||||
@ -676,9 +759,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.82"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
|
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"wasm-bindgen-macro",
|
"wasm-bindgen-macro",
|
||||||
@ -686,9 +769,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.82"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
|
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"log",
|
"log",
|
||||||
@ -701,9 +784,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.82"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
|
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
@ -711,9 +794,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.82"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
|
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -724,9 +807,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.82"
|
version = "0.2.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
|
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
@ -744,6 +827,15 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-util"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@ -752,46 +844,60 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
|
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
"windows_aarch64_msvc",
|
"windows_aarch64_msvc",
|
||||||
"windows_i686_gnu",
|
"windows_i686_gnu",
|
||||||
"windows_i686_msvc",
|
"windows_i686_msvc",
|
||||||
"windows_x86_64_gnu",
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
"windows_x86_64_msvc",
|
"windows_x86_64_msvc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
|
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
|
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
|
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
|
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.36.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
|
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
@ -805,11 +911,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy-derive"
|
name = "zerocopy-derive"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a0fbc82b82efe24da867ee52e015e58178684bd9dd64c34e66bdf21da2582a9f"
|
checksum = "6505e6815af7de1746a08f69c69606bb45695a17149517680f3b2149713b19a3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
"synstructure",
|
|
||||||
]
|
]
|
||||||
|
@ -6,19 +6,20 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
delegate = "0.8.0"
|
delegate = "0.8"
|
||||||
hashbrown = "0.12.3"
|
hashbrown = "0.12"
|
||||||
|
heapless = "0.7"
|
||||||
|
|
||||||
[dependencies.num-traits]
|
[dependencies.num-traits]
|
||||||
version = "0.2"
|
version = "0.2"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
[dependencies.downcast-rs]
|
[dependencies.downcast-rs]
|
||||||
version = "1.2.0"
|
version = "1.2"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
[dependencies.bus]
|
[dependencies.bus]
|
||||||
version = "2.2.3"
|
version = "2.2"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.crossbeam-channel]
|
[dependencies.crossbeam-channel]
|
||||||
@ -29,15 +30,15 @@ default-features = false
|
|||||||
path = "../spacepackets"
|
path = "../spacepackets"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde = "1.0.143"
|
serde = "1.0"
|
||||||
zerocopy = "0.6.1"
|
zerocopy = "0.6"
|
||||||
once_cell = "1.13.1"
|
once_cell = "1.13"
|
||||||
|
|
||||||
[dev-dependencies.postcard]
|
[dev-dependencies.postcard]
|
||||||
version = "1.0.1"
|
version = "1.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
std = ["downcast-rs/std", "alloc", "bus", "postcard/use-std", "crossbeam-channel/std"]
|
std = ["downcast-rs/std", "alloc", "bus", "postcard/use-std", "crossbeam-channel/std"]
|
||||||
alloc = []
|
alloc = []
|
||||||
|
heapless = []
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
//! Event support module
|
//! Event support module
|
||||||
|
|
||||||
|
use spacepackets::ecss::EcssEnumeration;
|
||||||
|
use spacepackets::{ByteConversionError, SizeMissmatch};
|
||||||
|
|
||||||
pub type GroupId = u16;
|
pub type GroupId = u16;
|
||||||
pub type UniqueId = u16;
|
pub type UniqueId = u16;
|
||||||
pub type EventRaw = u32;
|
pub type EventRaw = u32;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||||
pub enum Severity {
|
pub enum Severity {
|
||||||
INFO = 1,
|
INFO = 1,
|
||||||
LOW = 2,
|
LOW = 2,
|
||||||
@ -26,7 +29,7 @@ impl TryFrom<u8> for Severity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
pub struct Event {
|
pub struct Event {
|
||||||
severity: Severity,
|
severity: Severity,
|
||||||
group_id: GroupId,
|
group_id: GroupId,
|
||||||
@ -91,6 +94,23 @@ impl TryFrom<EventRaw> for Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl EcssEnumeration for Event {
|
||||||
|
fn pfc(&self) -> u8 {
|
||||||
|
32
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_bytes(&self, buf: &mut [u8]) -> Result<(), ByteConversionError> {
|
||||||
|
if buf.len() < self.byte_width() {
|
||||||
|
return Err(ByteConversionError::ToSliceTooSmall(SizeMissmatch {
|
||||||
|
found: buf.len(),
|
||||||
|
expected: self.byte_width(),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
buf.copy_from_slice(self.raw().to_be_bytes().as_slice());
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::Event;
|
use super::Event;
|
||||||
|
@ -41,7 +41,7 @@ use std::vec::Vec;
|
|||||||
/// let mut sph = SpHeader::tc(0x02, 0, 0).unwrap();
|
/// let mut sph = SpHeader::tc(0x02, 0, 0).unwrap();
|
||||||
/// let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
/// let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
||||||
/// let len = pus_tc
|
/// let len = pus_tc
|
||||||
/// .write_to(&mut buf)
|
/// .write_to_bytes(&mut buf)
|
||||||
/// .expect("Error writing PUS TC packet");
|
/// .expect("Error writing PUS TC packet");
|
||||||
/// assert_eq!(len, 13);
|
/// assert_eq!(len, 13);
|
||||||
/// let client = UdpSocket::bind("127.0.0.1:7778").expect("Connecting to UDP server failed");
|
/// let client = UdpSocket::bind("127.0.0.1:7778").expect("Connecting to UDP server failed");
|
||||||
@ -166,7 +166,7 @@ mod tests {
|
|||||||
let mut sph = SpHeader::tc(0x02, 0, 0).unwrap();
|
let mut sph = SpHeader::tc(0x02, 0, 0).unwrap();
|
||||||
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
||||||
let len = pus_tc
|
let len = pus_tc
|
||||||
.write_to(&mut buf)
|
.write_to_bytes(&mut buf)
|
||||||
.expect("Error writing PUS TC packet");
|
.expect("Error writing PUS TC packet");
|
||||||
let client = UdpSocket::bind("127.0.0.1:7778").expect("Connecting to UDP server failed");
|
let client = UdpSocket::bind("127.0.0.1:7778").expect("Connecting to UDP server failed");
|
||||||
client
|
client
|
||||||
|
446
fsrc-core/src/pus/event.rs
Normal file
446
fsrc-core/src/pus/event.rs
Normal file
@ -0,0 +1,446 @@
|
|||||||
|
use crate::pus::{source_buffer_large_enough, EcssTmError, EcssTmSender};
|
||||||
|
use spacepackets::ecss::EcssEnumeration;
|
||||||
|
use spacepackets::tm::PusTm;
|
||||||
|
use spacepackets::tm::PusTmSecondaryHeader;
|
||||||
|
use spacepackets::{SpHeader, MAX_APID};
|
||||||
|
|
||||||
|
#[cfg(feature = "alloc")]
|
||||||
|
pub use allocvec::EventReporter;
|
||||||
|
|
||||||
|
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
|
||||||
|
pub enum Subservices {
|
||||||
|
TmInfoReport = 1,
|
||||||
|
TmLowSeverityReport = 2,
|
||||||
|
TmMediumSeverityReport = 3,
|
||||||
|
TmHighSeverityReport = 4,
|
||||||
|
TcEnableEventGeneration = 5,
|
||||||
|
TcDisableEventGeneration = 6,
|
||||||
|
TcReportDisabledList = 7,
|
||||||
|
TmDisabledEventsReport = 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Subservices> for u8 {
|
||||||
|
fn from(enumeration: Subservices) -> Self {
|
||||||
|
enumeration as u8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct EventReporterBase {
|
||||||
|
msg_count: u16,
|
||||||
|
apid: u16,
|
||||||
|
pub dest_id: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EventReporterBase {
|
||||||
|
pub fn new(apid: u16) -> Option<Self> {
|
||||||
|
if apid > MAX_APID {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(Self {
|
||||||
|
msg_count: 0,
|
||||||
|
dest_id: 0,
|
||||||
|
apid,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_info<E>(
|
||||||
|
&mut self,
|
||||||
|
buf: &mut [u8],
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.generate_and_send_generic_tm(
|
||||||
|
buf,
|
||||||
|
Subservices::TmInfoReport,
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_low_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
buf: &mut [u8],
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.generate_and_send_generic_tm(
|
||||||
|
buf,
|
||||||
|
Subservices::TmLowSeverityReport,
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_medium_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
buf: &mut [u8],
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.generate_and_send_generic_tm(
|
||||||
|
buf,
|
||||||
|
Subservices::TmMediumSeverityReport,
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_high_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
buf: &mut [u8],
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.generate_and_send_generic_tm(
|
||||||
|
buf,
|
||||||
|
Subservices::TmHighSeverityReport,
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generate_and_send_generic_tm<E>(
|
||||||
|
&mut self,
|
||||||
|
buf: &mut [u8],
|
||||||
|
subservice: Subservices,
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
let tm = self.generate_generic_event_tm(buf, subservice, time_stamp, event_id, aux_data)?;
|
||||||
|
sender.send_tm(tm)?;
|
||||||
|
self.msg_count += 1;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generate_generic_event_tm<'a, E>(
|
||||||
|
&'a self,
|
||||||
|
buf: &'a mut [u8],
|
||||||
|
subservice: Subservices,
|
||||||
|
time_stamp: &'a [u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<PusTm, EcssTmError<E>> {
|
||||||
|
let mut src_data_len = event_id.byte_width();
|
||||||
|
if let Some(aux_data) = aux_data {
|
||||||
|
src_data_len += aux_data.len();
|
||||||
|
}
|
||||||
|
source_buffer_large_enough(buf.len(), src_data_len)?;
|
||||||
|
let mut sp_header = SpHeader::tm(self.apid, 0, 0).unwrap();
|
||||||
|
let sec_header = PusTmSecondaryHeader::new(
|
||||||
|
5,
|
||||||
|
subservice.into(),
|
||||||
|
self.msg_count,
|
||||||
|
self.dest_id,
|
||||||
|
time_stamp,
|
||||||
|
);
|
||||||
|
let mut current_idx = 0;
|
||||||
|
event_id.write_to_bytes(&mut buf[0..event_id.byte_width()])?;
|
||||||
|
current_idx += event_id.byte_width();
|
||||||
|
if let Some(aux_data) = aux_data {
|
||||||
|
buf[current_idx..current_idx + aux_data.len()].copy_from_slice(aux_data);
|
||||||
|
current_idx += aux_data.len();
|
||||||
|
}
|
||||||
|
Ok(PusTm::new(
|
||||||
|
&mut sp_header,
|
||||||
|
sec_header,
|
||||||
|
Some(&buf[0..current_idx]),
|
||||||
|
true,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "alloc")]
|
||||||
|
mod allocvec {
|
||||||
|
use super::*;
|
||||||
|
use alloc::vec;
|
||||||
|
use alloc::vec::Vec;
|
||||||
|
|
||||||
|
pub struct EventReporter {
|
||||||
|
source_data_buf: Vec<u8>,
|
||||||
|
pub reporter: EventReporterBase,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EventReporter {
|
||||||
|
pub fn new(apid: u16, max_event_id_and_aux_data_size: usize) -> Option<Self> {
|
||||||
|
let reporter = EventReporterBase::new(apid)?;
|
||||||
|
Some(Self {
|
||||||
|
source_data_buf: vec![0; max_event_id_and_aux_data_size],
|
||||||
|
reporter,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
pub fn event_info<E>(
|
||||||
|
&mut self,
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.reporter.event_info(
|
||||||
|
self.source_data_buf.as_mut_slice(),
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_low_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.reporter.event_low_severity(
|
||||||
|
self.source_data_buf.as_mut_slice(),
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_medium_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.reporter.event_medium_severity(
|
||||||
|
self.source_data_buf.as_mut_slice(),
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn event_high_severity<E>(
|
||||||
|
&mut self,
|
||||||
|
sender: &mut (impl EcssTmSender<E> + ?Sized),
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event_id: impl EcssEnumeration,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) -> Result<(), EcssTmError<E>> {
|
||||||
|
self.reporter.event_high_severity(
|
||||||
|
self.source_data_buf.as_mut_slice(),
|
||||||
|
sender,
|
||||||
|
time_stamp,
|
||||||
|
event_id,
|
||||||
|
aux_data,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use crate::events::{Event, Severity};
|
||||||
|
use crate::pus::tests::CommonTmInfo;
|
||||||
|
use spacepackets::ByteConversionError;
|
||||||
|
use std::collections::VecDeque;
|
||||||
|
use std::vec::Vec;
|
||||||
|
|
||||||
|
const EXAMPLE_APID: u16 = 0xee;
|
||||||
|
const EXAMPLE_GROUP_ID: u16 = 2;
|
||||||
|
const EXAMPLE_EVENT_ID_0: u16 = 1;
|
||||||
|
#[allow(dead_code)]
|
||||||
|
const EXAMPLE_EVENT_ID_1: u16 = 2;
|
||||||
|
|
||||||
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
|
struct TmInfo {
|
||||||
|
pub common: CommonTmInfo,
|
||||||
|
pub event: Event,
|
||||||
|
pub aux_data: Vec<u8>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct TestSender {
|
||||||
|
pub service_queue: VecDeque<TmInfo>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EcssTmSender<()> for TestSender {
|
||||||
|
fn send_tm(&mut self, tm: PusTm) -> Result<(), EcssTmError<()>> {
|
||||||
|
assert!(tm.source_data().is_some());
|
||||||
|
let src_data = tm.source_data().unwrap();
|
||||||
|
assert!(src_data.len() >= 4);
|
||||||
|
let event = Event::try_from(u32::from_be_bytes(src_data[0..4].try_into().unwrap()));
|
||||||
|
assert!(event.is_ok());
|
||||||
|
let event = event.unwrap();
|
||||||
|
let mut aux_data = Vec::new();
|
||||||
|
if src_data.len() > 4 {
|
||||||
|
aux_data.extend_from_slice(&src_data[4..]);
|
||||||
|
}
|
||||||
|
self.service_queue.push_back(TmInfo {
|
||||||
|
common: CommonTmInfo::new_from_tm(&tm),
|
||||||
|
event,
|
||||||
|
aux_data,
|
||||||
|
});
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn severity_to_subservice(severity: Severity) -> Subservices {
|
||||||
|
match severity {
|
||||||
|
Severity::INFO => Subservices::TmInfoReport,
|
||||||
|
Severity::LOW => Subservices::TmLowSeverityReport,
|
||||||
|
Severity::MEDIUM => Subservices::TmMediumSeverityReport,
|
||||||
|
Severity::HIGH => Subservices::TmHighSeverityReport,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn report_basic_event(
|
||||||
|
reporter: &mut EventReporter,
|
||||||
|
sender: &mut TestSender,
|
||||||
|
time_stamp: &[u8],
|
||||||
|
event: Event,
|
||||||
|
severity: Severity,
|
||||||
|
aux_data: Option<&[u8]>,
|
||||||
|
) {
|
||||||
|
match severity {
|
||||||
|
Severity::INFO => {
|
||||||
|
reporter
|
||||||
|
.event_info(sender, time_stamp, event, aux_data)
|
||||||
|
.expect("Error reporting info event");
|
||||||
|
}
|
||||||
|
Severity::LOW => {
|
||||||
|
reporter
|
||||||
|
.event_low_severity(sender, time_stamp, event, aux_data)
|
||||||
|
.expect("Error reporting low event");
|
||||||
|
}
|
||||||
|
Severity::MEDIUM => {
|
||||||
|
reporter
|
||||||
|
.event_medium_severity(sender, time_stamp, event, aux_data)
|
||||||
|
.expect("Error reporting medium event");
|
||||||
|
}
|
||||||
|
Severity::HIGH => {
|
||||||
|
reporter
|
||||||
|
.event_high_severity(sender, time_stamp, event, aux_data)
|
||||||
|
.expect("Error reporting high event");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn basic_event_test(
|
||||||
|
max_event_aux_data_buf: usize,
|
||||||
|
severity: Severity,
|
||||||
|
error_data: Option<&[u8]>,
|
||||||
|
) {
|
||||||
|
let mut sender = TestSender::default();
|
||||||
|
let reporter = EventReporter::new(EXAMPLE_APID, max_event_aux_data_buf);
|
||||||
|
assert!(reporter.is_some());
|
||||||
|
let mut reporter = reporter.unwrap();
|
||||||
|
let time_stamp_empty: [u8; 7] = [0; 7];
|
||||||
|
let mut error_copy = Vec::new();
|
||||||
|
if let Some(err_data) = error_data {
|
||||||
|
error_copy.extend_from_slice(err_data);
|
||||||
|
}
|
||||||
|
let event = Event::new(severity, EXAMPLE_GROUP_ID, EXAMPLE_EVENT_ID_0)
|
||||||
|
.expect("Error creating example event");
|
||||||
|
report_basic_event(
|
||||||
|
&mut reporter,
|
||||||
|
&mut sender,
|
||||||
|
&time_stamp_empty,
|
||||||
|
event,
|
||||||
|
severity,
|
||||||
|
error_data,
|
||||||
|
);
|
||||||
|
assert_eq!(sender.service_queue.len(), 1);
|
||||||
|
let tm_info = sender.service_queue.pop_front().unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
tm_info.common.subservice,
|
||||||
|
severity_to_subservice(severity) as u8
|
||||||
|
);
|
||||||
|
assert_eq!(tm_info.common.dest_id, 0);
|
||||||
|
assert_eq!(tm_info.common.time_stamp, time_stamp_empty);
|
||||||
|
assert_eq!(tm_info.common.msg_counter, 0);
|
||||||
|
assert_eq!(tm_info.common.apid, EXAMPLE_APID);
|
||||||
|
assert_eq!(tm_info.event, event);
|
||||||
|
assert_eq!(tm_info.aux_data, error_copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic_info_event_generation() {
|
||||||
|
basic_event_test(4, Severity::INFO, None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic_low_severity_event() {
|
||||||
|
basic_event_test(4, Severity::LOW, None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic_medium_severity_event() {
|
||||||
|
basic_event_test(4, Severity::MEDIUM, None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic_high_severity_event() {
|
||||||
|
basic_event_test(4, Severity::HIGH, None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn event_with_info_string() {
|
||||||
|
let info_string = "Test Information";
|
||||||
|
basic_event_test(32, Severity::INFO, Some(info_string.as_bytes()));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn low_severity_with_raw_err_data() {
|
||||||
|
let raw_err_param: i32 = -1;
|
||||||
|
let raw_err = raw_err_param.to_be_bytes();
|
||||||
|
basic_event_test(8, Severity::LOW, Some(&raw_err))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn check_buf_too_small(
|
||||||
|
reporter: &mut EventReporter,
|
||||||
|
sender: &mut TestSender,
|
||||||
|
expected_found_len: usize,
|
||||||
|
) {
|
||||||
|
let time_stamp_empty: [u8; 7] = [0; 7];
|
||||||
|
let event = Event::new(Severity::INFO, EXAMPLE_GROUP_ID, EXAMPLE_EVENT_ID_0)
|
||||||
|
.expect("Error creating example event");
|
||||||
|
let err = reporter.event_info(sender, &time_stamp_empty, event, None);
|
||||||
|
assert!(err.is_err());
|
||||||
|
let err = err.unwrap_err();
|
||||||
|
if let EcssTmError::ByteConversionError(ByteConversionError::ToSliceTooSmall(missmatch)) =
|
||||||
|
err
|
||||||
|
{
|
||||||
|
assert_eq!(missmatch.expected, 4);
|
||||||
|
assert_eq!(missmatch.found, expected_found_len);
|
||||||
|
} else {
|
||||||
|
panic!("Unexpected error {:?}", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn insufficient_buffer() {
|
||||||
|
let mut sender = TestSender::default();
|
||||||
|
for i in 0..3 {
|
||||||
|
let reporter = EventReporter::new(EXAMPLE_APID, i);
|
||||||
|
assert!(reporter.is_some());
|
||||||
|
let mut reporter = reporter.unwrap();
|
||||||
|
check_buf_too_small(&mut reporter, &mut sender, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
79
fsrc-core/src/pus/event_man.rs
Normal file
79
fsrc-core/src/pus/event_man.rs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
use crate::events::Event;
|
||||||
|
use hashbrown::HashSet;
|
||||||
|
|
||||||
|
#[cfg(feature = "heapless")]
|
||||||
|
pub use heapless_mod::*;
|
||||||
|
|
||||||
|
/// This trait allows the PUS event manager implementation to stay generic over various types
|
||||||
|
/// of backend containers. These backend containers keep track on whether a particular event
|
||||||
|
/// is enabled or disabled for reporting and also expose a simple API to enable or disable the event
|
||||||
|
/// reporting.
|
||||||
|
///
|
||||||
|
/// For example, a straight forward implementation for host systems could use a
|
||||||
|
/// [hash set](https://docs.rs/hashbrown/latest/hashbrown/struct.HashSet.html)
|
||||||
|
/// structure to track disabled events. A more primitive and embedded friendly
|
||||||
|
/// solution could track this information in a static or pre-allocated list which contains
|
||||||
|
/// the disabled events.
|
||||||
|
pub trait PusEventMgmtBackendProvider {
|
||||||
|
type Error;
|
||||||
|
|
||||||
|
fn event_enabled(&self, event: &Event) -> bool;
|
||||||
|
fn enable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error>;
|
||||||
|
fn disable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Default backend provider which uses a hash set as the event reporting status container
|
||||||
|
/// like mentioned in the example of the [PusEventMgmtBackendProvider] documentation.
|
||||||
|
///
|
||||||
|
/// This provider is a good option for host systems or larger embedded systems where
|
||||||
|
/// the expected occasional memory allocation performed by the [HashSet] is not an issue.
|
||||||
|
#[derive(Default)]
|
||||||
|
pub struct DefaultPusMgmtBackendProvider {
|
||||||
|
disabled: HashSet<Event>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PusEventMgmtBackendProvider for DefaultPusMgmtBackendProvider {
|
||||||
|
type Error = ();
|
||||||
|
fn event_enabled(&self, event: &Event) -> bool {
|
||||||
|
!self.disabled.contains(event)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn enable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error> {
|
||||||
|
Ok(self.disabled.remove(event))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn disable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error> {
|
||||||
|
Ok(self.disabled.insert(*event))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "heapless")]
|
||||||
|
pub mod heapless_mod {
|
||||||
|
use super::*;
|
||||||
|
use crate::events::EventRaw;
|
||||||
|
|
||||||
|
// TODO: After a new version of heapless is released which uses hash32 version 0.3, try using
|
||||||
|
// regular Event type again.
|
||||||
|
#[derive(Default)]
|
||||||
|
pub struct HeaplessPusMgmtBckendProvider<const N: usize> {
|
||||||
|
disabled: heapless::FnvIndexSet<EventRaw, N>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<const N: usize> PusEventMgmtBackendProvider for HeaplessPusMgmtBckendProvider<N> {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn event_enabled(&self, event: &Event) -> bool {
|
||||||
|
self.disabled.contains(&event.raw())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn enable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error> {
|
||||||
|
self.disabled.insert(event.raw()).map_err(|_| ())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn disable_event_reporting(&mut self, event: &Event) -> Result<bool, Self::Error> {
|
||||||
|
Ok(self.disabled.remove(&event.raw()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PusEventManager {}
|
@ -3,5 +3,82 @@
|
|||||||
//! Currenty includes:
|
//! Currenty includes:
|
||||||
//!
|
//!
|
||||||
//! 1. PUS Verification Service 1 module inside [verification]. Requires [alloc] support.
|
//! 1. PUS Verification Service 1 module inside [verification]. Requires [alloc] support.
|
||||||
#[cfg(feature = "alloc")]
|
use downcast_rs::{impl_downcast, Downcast};
|
||||||
|
use spacepackets::ecss::PusError;
|
||||||
|
use spacepackets::time::TimestampError;
|
||||||
|
use spacepackets::tm::PusTm;
|
||||||
|
use spacepackets::{ByteConversionError, SizeMissmatch};
|
||||||
|
|
||||||
|
pub mod event;
|
||||||
|
pub mod event_man;
|
||||||
pub mod verification;
|
pub mod verification;
|
||||||
|
|
||||||
|
/// Generic error type which is also able to wrap a user send error with the user supplied type E.
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub enum EcssTmError<E> {
|
||||||
|
/// Errors related to sending the verification telemetry to a TM recipient
|
||||||
|
SendError(E),
|
||||||
|
/// Errors related to the time stamp format of the telemetry
|
||||||
|
TimestampError(TimestampError),
|
||||||
|
/// Errors related to byte conversion, for example insufficient buffer size for given data
|
||||||
|
ByteConversionError(ByteConversionError),
|
||||||
|
/// Errors related to PUS packet format
|
||||||
|
PusError(PusError),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<E> From<ByteConversionError> for EcssTmError<E> {
|
||||||
|
fn from(e: ByteConversionError) -> Self {
|
||||||
|
EcssTmError::ByteConversionError(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Generic trait for a user supplied sender object. This sender object is responsible for sending
|
||||||
|
/// telemetry to a TM sink. The [Downcast] trait
|
||||||
|
/// is implemented to allow passing the sender as a boxed trait object and still retrieve the
|
||||||
|
/// concrete type at a later point.
|
||||||
|
pub trait EcssTmSender<E>: Downcast + Send {
|
||||||
|
fn send_tm(&mut self, tm: PusTm) -> Result<(), EcssTmError<E>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl_downcast!(EcssTmSender<E>);
|
||||||
|
|
||||||
|
pub(crate) fn source_buffer_large_enough<E>(cap: usize, len: usize) -> Result<(), EcssTmError<E>> {
|
||||||
|
if len > cap {
|
||||||
|
return Err(EcssTmError::ByteConversionError(
|
||||||
|
ByteConversionError::ToSliceTooSmall(SizeMissmatch {
|
||||||
|
found: cap,
|
||||||
|
expected: len,
|
||||||
|
}),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub(crate) mod tests {
|
||||||
|
use spacepackets::tm::{PusTm, PusTmSecondaryHeaderT};
|
||||||
|
use spacepackets::CcsdsPacket;
|
||||||
|
|
||||||
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
|
pub(crate) struct CommonTmInfo {
|
||||||
|
pub subservice: u8,
|
||||||
|
pub apid: u16,
|
||||||
|
pub msg_counter: u16,
|
||||||
|
pub dest_id: u16,
|
||||||
|
pub time_stamp: [u8; 7],
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CommonTmInfo {
|
||||||
|
pub fn new_from_tm(tm: &PusTm) -> Self {
|
||||||
|
let mut time_stamp = [0; 7];
|
||||||
|
time_stamp.clone_from_slice(&tm.time_stamp()[0..7]);
|
||||||
|
Self {
|
||||||
|
subservice: tm.subservice(),
|
||||||
|
apid: tm.apid(),
|
||||||
|
msg_counter: tm.msg_counter(),
|
||||||
|
dest_id: tm.dest_id(),
|
||||||
|
time_stamp,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -58,7 +58,7 @@
|
|||||||
//! let mut pus_tc = PusTc::new_simple(&mut space_packet_header, 17, 1, None, true);
|
//! let mut pus_tc = PusTc::new_simple(&mut space_packet_header, 17, 1, None, true);
|
||||||
//! let mut test_buf: [u8; 32] = [0; 32];
|
//! let mut test_buf: [u8; 32] = [0; 32];
|
||||||
//! let mut size = pus_tc
|
//! let mut size = pus_tc
|
||||||
//! .write_to(test_buf.as_mut_slice())
|
//! .write_to_bytes(test_buf.as_mut_slice())
|
||||||
//! .expect("Error writing TC to buffer");
|
//! .expect("Error writing TC to buffer");
|
||||||
//! let tc_slice = &test_buf[0..size];
|
//! let tc_slice = &test_buf[0..size];
|
||||||
//! ccsds_distributor.pass_tc(&tc_slice).expect("Passing TC slice failed");
|
//! ccsds_distributor.pass_tc(&tc_slice).expect("Passing TC slice failed");
|
||||||
@ -66,7 +66,7 @@
|
|||||||
//! // Now pass a packet with an unknown APID to the distributor
|
//! // Now pass a packet with an unknown APID to the distributor
|
||||||
//! pus_tc.set_apid(0x003);
|
//! pus_tc.set_apid(0x003);
|
||||||
//! size = pus_tc
|
//! size = pus_tc
|
||||||
//! .write_to(test_buf.as_mut_slice())
|
//! .write_to_bytes(test_buf.as_mut_slice())
|
||||||
//! .expect("Error writing TC to buffer");
|
//! .expect("Error writing TC to buffer");
|
||||||
//! let tc_slice = &test_buf[0..size];
|
//! let tc_slice = &test_buf[0..size];
|
||||||
//! ccsds_distributor.pass_tc(&tc_slice).expect("Passing TC slice failed");
|
//! ccsds_distributor.pass_tc(&tc_slice).expect("Passing TC slice failed");
|
||||||
@ -201,7 +201,9 @@ pub(crate) mod tests {
|
|||||||
pub fn generate_ping_tc(buf: &mut [u8]) -> &[u8] {
|
pub fn generate_ping_tc(buf: &mut [u8]) -> &[u8] {
|
||||||
let mut sph = SpHeader::tc(0x002, 0x34, 0).unwrap();
|
let mut sph = SpHeader::tc(0x002, 0x34, 0).unwrap();
|
||||||
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
||||||
let size = pus_tc.write_to(buf).expect("Error writing TC to buffer");
|
let size = pus_tc
|
||||||
|
.write_to_bytes(buf)
|
||||||
|
.expect("Error writing TC to buffer");
|
||||||
assert_eq!(size, 13);
|
assert_eq!(size, 13);
|
||||||
&buf[0..size]
|
&buf[0..size]
|
||||||
}
|
}
|
||||||
@ -314,7 +316,7 @@ pub(crate) mod tests {
|
|||||||
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
let pus_tc = PusTc::new_simple(&mut sph, 17, 1, None, true);
|
||||||
let mut test_buf: [u8; 32] = [0; 32];
|
let mut test_buf: [u8; 32] = [0; 32];
|
||||||
pus_tc
|
pus_tc
|
||||||
.write_to(test_buf.as_mut_slice())
|
.write_to_bytes(test_buf.as_mut_slice())
|
||||||
.expect("Error writing TC to buffer");
|
.expect("Error writing TC to buffer");
|
||||||
ccsds_distrib.pass_tc(&test_buf).expect("Passing TC failed");
|
ccsds_distrib.pass_tc(&test_buf).expect("Passing TC failed");
|
||||||
let recvd = unknown_packet_queue.lock().unwrap().pop_front();
|
let recvd = unknown_packet_queue.lock().unwrap().pop_front();
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
//! let mut pus_tc = PusTc::new_simple(&mut space_packet_header, 17, 1, None, true);
|
//! let mut pus_tc = PusTc::new_simple(&mut space_packet_header, 17, 1, None, true);
|
||||||
//! let mut test_buf: [u8; 32] = [0; 32];
|
//! let mut test_buf: [u8; 32] = [0; 32];
|
||||||
//! let mut size = pus_tc
|
//! let mut size = pus_tc
|
||||||
//! .write_to(test_buf.as_mut_slice())
|
//! .write_to_bytes(test_buf.as_mut_slice())
|
||||||
//! .expect("Error writing TC to buffer");
|
//! .expect("Error writing TC to buffer");
|
||||||
//! let tc_slice = &test_buf[0..size];
|
//! let tc_slice = &test_buf[0..size];
|
||||||
//!
|
//!
|
||||||
@ -99,7 +99,7 @@ impl<E: 'static> ReceivesTc for PusDistributor<E> {
|
|||||||
fn pass_tc(&mut self, tm_raw: &[u8]) -> Result<(), Self::Error> {
|
fn pass_tc(&mut self, tm_raw: &[u8]) -> Result<(), Self::Error> {
|
||||||
// Convert to ccsds and call pass_ccsds
|
// Convert to ccsds and call pass_ccsds
|
||||||
let sp_header = SpHeader::from_raw_slice(tm_raw)
|
let sp_header = SpHeader::from_raw_slice(tm_raw)
|
||||||
.map_err(|e| PusDistribError::PusError(PusError::PacketError(e)))?;
|
.map_err(|e| PusDistribError::PusError(PusError::ByteConversionError(e)))?;
|
||||||
self.pass_ccsds(&sp_header, tm_raw)
|
self.pass_ccsds(&sp_header, tm_raw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,8 +107,7 @@ impl<E: 'static> ReceivesTc for PusDistributor<E> {
|
|||||||
impl<E: 'static> ReceivesCcsdsTc for PusDistributor<E> {
|
impl<E: 'static> ReceivesCcsdsTc for PusDistributor<E> {
|
||||||
type Error = PusDistribError<E>;
|
type Error = PusDistribError<E>;
|
||||||
fn pass_ccsds(&mut self, header: &SpHeader, tm_raw: &[u8]) -> Result<(), Self::Error> {
|
fn pass_ccsds(&mut self, header: &SpHeader, tm_raw: &[u8]) -> Result<(), Self::Error> {
|
||||||
let (tc, _) =
|
let (tc, _) = PusTc::from_bytes(tm_raw).map_err(|e| PusDistribError::PusError(e))?;
|
||||||
PusTc::new_from_raw_slice(tm_raw).map_err(|e| PusDistribError::PusError(e))?;
|
|
||||||
self.pass_pus_tc(header, &tc)
|
self.pass_pus_tc(header, &tc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
fsrc-core/tests/pus_events.rs
Normal file
1
fsrc-core/tests/pus_events.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
@ -25,7 +25,7 @@ const PACKETS_SENT: u8 = 8;
|
|||||||
/// threads have sent the correct expected verification reports
|
/// threads have sent the correct expected verification reports
|
||||||
#[test]
|
#[test]
|
||||||
fn test_shared_reporter() {
|
fn test_shared_reporter() {
|
||||||
let cfg = VerificationReporterCfg::new(TEST_APID, 1, 2, 8);
|
let cfg = VerificationReporterCfg::new(TEST_APID, 1, 2, 8).unwrap();
|
||||||
// Shared pool object to store the verification PUS telemetry
|
// Shared pool object to store the verification PUS telemetry
|
||||||
let pool_cfg = PoolCfg::new(vec![(10, 32), (10, 64), (10, 128), (10, 1024)]);
|
let pool_cfg = PoolCfg::new(vec![(10, 32), (10, 64), (10, 128), (10, 1024)]);
|
||||||
let shared_tm_pool: SharedPool =
|
let shared_tm_pool: SharedPool =
|
||||||
@ -53,14 +53,14 @@ fn test_shared_reporter() {
|
|||||||
let pus_tc_0 = PusTc::new(&mut sph, tc_header, None, true);
|
let pus_tc_0 = PusTc::new(&mut sph, tc_header, None, true);
|
||||||
req_id_0 = RequestId::new(&pus_tc_0);
|
req_id_0 = RequestId::new(&pus_tc_0);
|
||||||
let (addr, mut buf) = tc_guard.free_element(pus_tc_0.len_packed()).unwrap();
|
let (addr, mut buf) = tc_guard.free_element(pus_tc_0.len_packed()).unwrap();
|
||||||
pus_tc_0.write_to(&mut buf).unwrap();
|
pus_tc_0.write_to_bytes(&mut buf).unwrap();
|
||||||
tx_tc_0.send(addr).unwrap();
|
tx_tc_0.send(addr).unwrap();
|
||||||
let mut sph = SpHeader::tc(TEST_APID, 1, 0).unwrap();
|
let mut sph = SpHeader::tc(TEST_APID, 1, 0).unwrap();
|
||||||
let tc_header = PusTcSecondaryHeader::new_simple(5, 1);
|
let tc_header = PusTcSecondaryHeader::new_simple(5, 1);
|
||||||
let pus_tc_1 = PusTc::new(&mut sph, tc_header, None, true);
|
let pus_tc_1 = PusTc::new(&mut sph, tc_header, None, true);
|
||||||
req_id_1 = RequestId::new(&pus_tc_1);
|
req_id_1 = RequestId::new(&pus_tc_1);
|
||||||
let (addr, mut buf) = tc_guard.free_element(pus_tc_0.len_packed()).unwrap();
|
let (addr, mut buf) = tc_guard.free_element(pus_tc_0.len_packed()).unwrap();
|
||||||
pus_tc_1.write_to(&mut buf).unwrap();
|
pus_tc_1.write_to_bytes(&mut buf).unwrap();
|
||||||
tx_tc_1.send(addr).unwrap();
|
tx_tc_1.send(addr).unwrap();
|
||||||
}
|
}
|
||||||
let verif_sender_0 = thread::spawn(move || {
|
let verif_sender_0 = thread::spawn(move || {
|
||||||
@ -76,7 +76,7 @@ fn test_shared_reporter() {
|
|||||||
tc_len = buf.len();
|
tc_len = buf.len();
|
||||||
tc_buf[0..tc_len].copy_from_slice(buf);
|
tc_buf[0..tc_len].copy_from_slice(buf);
|
||||||
}
|
}
|
||||||
let (_tc, _) = PusTc::new_from_raw_slice(&tc_buf[0..tc_len]).unwrap();
|
let (_tc, _) = PusTc::from_bytes(&tc_buf[0..tc_len]).unwrap();
|
||||||
let accepted_token;
|
let accepted_token;
|
||||||
{
|
{
|
||||||
let mut mg = reporter_with_sender_0.lock().expect("Locking mutex failed");
|
let mut mg = reporter_with_sender_0.lock().expect("Locking mutex failed");
|
||||||
@ -117,7 +117,7 @@ fn test_shared_reporter() {
|
|||||||
tc_len = buf.len();
|
tc_len = buf.len();
|
||||||
tc_buf[0..tc_len].copy_from_slice(buf);
|
tc_buf[0..tc_len].copy_from_slice(buf);
|
||||||
}
|
}
|
||||||
let (tc, _) = PusTc::new_from_raw_slice(&tc_buf[0..tc_len]).unwrap();
|
let (tc, _) = PusTc::from_bytes(&tc_buf[0..tc_len]).unwrap();
|
||||||
let mut mg = reporter_with_sender_1
|
let mut mg = reporter_with_sender_1
|
||||||
.lock()
|
.lock()
|
||||||
.expect("Locking reporter failed");
|
.expect("Locking reporter failed");
|
||||||
@ -150,8 +150,8 @@ fn test_shared_reporter() {
|
|||||||
tm_len = slice.len();
|
tm_len = slice.len();
|
||||||
tm_buf[0..tm_len].copy_from_slice(slice);
|
tm_buf[0..tm_len].copy_from_slice(slice);
|
||||||
}
|
}
|
||||||
let (pus_tm, _) = PusTm::new_from_raw_slice(&tm_buf[0..tm_len], 7)
|
let (pus_tm, _) =
|
||||||
.expect("Error reading verification TM");
|
PusTm::from_bytes(&tm_buf[0..tm_len], 7).expect("Error reading verification TM");
|
||||||
let req_id = RequestId::from_bytes(
|
let req_id = RequestId::from_bytes(
|
||||||
&pus_tm.source_data().expect("Invalid TM source data")[0..RequestId::SIZE_AS_BYTES],
|
&pus_tm.source_data().expect("Invalid TM source data")[0..RequestId::SIZE_AS_BYTES],
|
||||||
)
|
)
|
@ -7,6 +7,7 @@ authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
crossbeam-channel = "0.5"
|
crossbeam-channel = "0.5"
|
||||||
delegate = "0.8"
|
delegate = "0.8"
|
||||||
|
zerocopy = "0.6"
|
||||||
|
|
||||||
[dependencies.spacepackets]
|
[dependencies.spacepackets]
|
||||||
path = "../spacepackets"
|
path = "../spacepackets"
|
||||||
|
@ -18,7 +18,9 @@ fn main() {
|
|||||||
"Packing and sending PUS ping command TC[17,1] with request ID {}",
|
"Packing and sending PUS ping command TC[17,1] with request ID {}",
|
||||||
tc_req_id
|
tc_req_id
|
||||||
);
|
);
|
||||||
let size = pus_tc.write_to(&mut buf).expect("Creating PUS TC failed");
|
let size = pus_tc
|
||||||
|
.write_to_bytes(&mut buf)
|
||||||
|
.expect("Creating PUS TC failed");
|
||||||
client
|
client
|
||||||
.send_to(&buf[0..size], &addr)
|
.send_to(&buf[0..size], &addr)
|
||||||
.expect(&*format!("Sending to {:?} failed", addr));
|
.expect(&*format!("Sending to {:?} failed", addr));
|
||||||
@ -29,8 +31,7 @@ fn main() {
|
|||||||
let res = client.recv(&mut buf);
|
let res = client.recv(&mut buf);
|
||||||
match res {
|
match res {
|
||||||
Ok(_len) => {
|
Ok(_len) => {
|
||||||
let (pus_tm, size) =
|
let (pus_tm, size) = PusTm::from_bytes(&buf, 7).expect("Parsing PUS TM failed");
|
||||||
PusTm::new_from_raw_slice(&buf, 7).expect("Parsing PUS TM failed");
|
|
||||||
if pus_tm.service() == 17 && pus_tm.subservice() == 2 {
|
if pus_tm.service() == 17 && pus_tm.subservice() == 2 {
|
||||||
println!("Received PUS Ping Reply TM[17,2]")
|
println!("Received PUS Ping Reply TM[17,2]")
|
||||||
} else if pus_tm.service() == 1 {
|
} else if pus_tm.service() == 1 {
|
||||||
|
@ -39,7 +39,7 @@ fn main() {
|
|||||||
let (tm_funnel_tx, tm_funnel_rx) = mpsc::channel();
|
let (tm_funnel_tx, tm_funnel_rx) = mpsc::channel();
|
||||||
let (tm_server_tx, tm_server_rx) = mpsc::channel();
|
let (tm_server_tx, tm_server_rx) = mpsc::channel();
|
||||||
let sender = MpscVerifSender::new(tm_store.clone(), tm_funnel_tx.clone());
|
let sender = MpscVerifSender::new(tm_store.clone(), tm_funnel_tx.clone());
|
||||||
let verif_cfg = VerificationReporterCfg::new(PUS_APID, 1, 2, 8);
|
let verif_cfg = VerificationReporterCfg::new(PUS_APID, 1, 2, 8).unwrap();
|
||||||
let reporter_with_sender_0 = Arc::new(Mutex::new(VerificationReporterWithSender::new(
|
let reporter_with_sender_0 = Arc::new(Mutex::new(VerificationReporterWithSender::new(
|
||||||
verif_cfg,
|
verif_cfg,
|
||||||
Box::new(sender),
|
Box::new(sender),
|
||||||
|
@ -24,7 +24,7 @@ impl TmStore {
|
|||||||
let mut pg = self.pool.write().expect("Error locking TM store");
|
let mut pg = self.pool.write().expect("Error locking TM store");
|
||||||
let (addr, buf) = pg.free_element(pus_tm.len_packed()).expect("Store error");
|
let (addr, buf) = pg.free_element(pus_tm.len_packed()).expect("Store error");
|
||||||
pus_tm
|
pus_tm
|
||||||
.write_to(buf)
|
.write_to_bytes(buf)
|
||||||
.expect("Writing PUS TM to store failed");
|
.expect("Writing PUS TM to store failed");
|
||||||
addr
|
addr
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
use crossbeam_channel::{bounded, Receiver, Sender};
|
use crossbeam_channel::{bounded, Receiver, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
use zerocopy::{AsBytes, FromBytes, NetworkEndian, Unaligned, U16};
|
||||||
|
|
||||||
trait FieldDataProvider: Send {
|
trait FieldDataProvider: Send {
|
||||||
fn get_data(&self) -> &[u8];
|
fn get_data(&self) -> &[u8];
|
||||||
@ -26,6 +28,18 @@ impl FieldDataProvider for FixedFieldDataWrapper {
|
|||||||
|
|
||||||
type FieldDataTraitObj = Box<dyn FieldDataProvider>;
|
type FieldDataTraitObj = Box<dyn FieldDataProvider>;
|
||||||
|
|
||||||
|
struct ExampleMgmSet {
|
||||||
|
mgm_vec: [f32; 3],
|
||||||
|
temperature: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(FromBytes, AsBytes, Unaligned)]
|
||||||
|
#[repr(C)]
|
||||||
|
struct ExampleMgmSetZc {
|
||||||
|
mgm_vec: [u8; 12],
|
||||||
|
temperatur: U16<NetworkEndian>,
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let (s0, r0): (Sender<FieldDataTraitObj>, Receiver<FieldDataTraitObj>) = bounded(5);
|
let (s0, r0): (Sender<FieldDataTraitObj>, Receiver<FieldDataTraitObj>) = bounded(5);
|
||||||
let data_wrapper = FixedFieldDataWrapper::from_two_u32(2, 3);
|
let data_wrapper = FixedFieldDataWrapper::from_two_u32(2, 3);
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 94489da00323dc6caf24e05e240c80fc10b5d8cc
|
Subproject commit 603f688ac3e914de13037fd22ac544e125b6305b
|
Loading…
Reference in New Issue
Block a user