diff --git a/bin_delivery/hermes/13_05_2019/test-all-sensors/test-all-sensors.bin b/bin_delivery/hermes/13_05_2019/test-all-sensors/test-all-sensors.bin new file mode 100755 index 0000000000000000000000000000000000000000..ff1d90838bc596630857cc6c98ff40e2d19aba7f Binary files /dev/null and b/bin_delivery/hermes/13_05_2019/test-all-sensors/test-all-sensors.bin differ diff --git a/bin_delivery/hermes/13_05_2019/test-logger/test-logger.bin b/bin_delivery/hermes/13_05_2019/test-logger/test-logger.bin new file mode 100755 index 0000000000000000000000000000000000000000..1e4305f1b3d7cbb0efa1c5fbb37f2d2baaeb0144 Binary files /dev/null and b/bin_delivery/hermes/13_05_2019/test-logger/test-logger.bin differ diff --git a/bin_delivery/hermes/13_05_2019/xbee-send-rcv/xbee-send-rcv.bin b/bin_delivery/hermes/13_05_2019/xbee-send-rcv/xbee-send-rcv.bin new file mode 100755 index 0000000000000000000000000000000000000000..be0864ffdb6b1ff5cfd28953f085b1f18c4b9b44 Binary files /dev/null and b/bin_delivery/hermes/13_05_2019/xbee-send-rcv/xbee-send-rcv.bin differ diff --git a/bin_delivery/hermes/14_05_2019/README.md b/bin_delivery/hermes/14_05_2019/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f1ff996fd95c29d04072ed49107c7c7c63df0501 --- /dev/null +++ b/bin_delivery/hermes/14_05_2019/README.md @@ -0,0 +1,19 @@ +# Tests 14/05/2019 + +**Working** +* sensors + logger +* SM +* ADA + Kalman (static test) +* Mavlink +* Mavchannel (send and rcv from GS without send queue logic) + +**Not working** +* TMTC + Xbee (can only receive while sending) +* Mavchannel with send queue logic + +**Untested** +* GPS +* Nosecone motor +* Rogallo servos +* FMM + diff --git a/bin_delivery/hermes/14_05_2019/test-mavchannel/test-mavchannel.bin b/bin_delivery/hermes/14_05_2019/test-mavchannel/test-mavchannel.bin new file mode 100755 index 0000000000000000000000000000000000000000..92c26bfc40feee1c9a8cce201131366d723c9873 Binary files /dev/null and b/bin_delivery/hermes/14_05_2019/test-mavchannel/test-mavchannel.bin differ diff --git a/bin_delivery/hermes/14_05_2019/test-mavlink/test-mavlink.bin b/bin_delivery/hermes/14_05_2019/test-mavlink/test-mavlink.bin new file mode 100755 index 0000000000000000000000000000000000000000..c5b0282e46733a557c48a9a6516dfbaecd521303 Binary files /dev/null and b/bin_delivery/hermes/14_05_2019/test-mavlink/test-mavlink.bin differ diff --git a/bin_delivery/hermes/15_05_2019/README.md b/bin_delivery/hermes/15_05_2019/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d8791a60f8ae3c862bc48da6be97ddccd2eba19f --- /dev/null +++ b/bin_delivery/hermes/15_05_2019/README.md @@ -0,0 +1,21 @@ +# Tests 15/05/2019 + +**Working** +* MavChannel +* TMTC (send and rcv, handling has to be checked) +* Nosecone motor + +**Not working** +* GS + +**Untested** + +* TMTC TC handling +* GPS +* Motor direction + +**Todo** + +* Rogallo servos +* FMM + diff --git a/bin_delivery/hermes/15_05_2019/test-motor/test-motor.bin b/bin_delivery/hermes/15_05_2019/test-motor/test-motor.bin new file mode 100755 index 0000000000000000000000000000000000000000..c8ba8494f0fb31e5d9f11957a9db89c18fd052ed Binary files /dev/null and b/bin_delivery/hermes/15_05_2019/test-motor/test-motor.bin differ diff --git a/bin_delivery/hermes/15_05_2019/test-tmtc/test-tmtc.bin b/bin_delivery/hermes/15_05_2019/test-tmtc/test-tmtc.bin new file mode 100755 index 0000000000000000000000000000000000000000..73b79e33212955fb8588fc1fd7a0a33048d441f8 Binary files /dev/null and b/bin_delivery/hermes/15_05_2019/test-tmtc/test-tmtc.bin differ diff --git a/bin_delivery/hermes/20_05_19/death-stack-entry.bin b/bin_delivery/hermes/20_05_19/death-stack-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..6714a29d7e7038287fce7d02cda5f40c2a906339 Binary files /dev/null and b/bin_delivery/hermes/20_05_19/death-stack-entry.bin differ diff --git a/bin_delivery/hermes/28_05_19/test-all-sensors/test-all-sensors.bin b/bin_delivery/hermes/28_05_19/test-all-sensors/test-all-sensors.bin new file mode 100755 index 0000000000000000000000000000000000000000..67c99ec1b6f0b61c57d1c929bbf614e70b2c3cc9 Binary files /dev/null and b/bin_delivery/hermes/28_05_19/test-all-sensors/test-all-sensors.bin differ diff --git a/bin_delivery/hermes/final/death-stack-entry/death-stack-entry.bin b/bin_delivery/hermes/final/death-stack-entry/death-stack-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..76a90770d2b2924f709d1516f26cb6a927156d04 Binary files /dev/null and b/bin_delivery/hermes/final/death-stack-entry/death-stack-entry.bin differ diff --git a/bin_delivery/hermes/final/ramtest/ramtest.bin b/bin_delivery/hermes/final/ramtest/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..711e6eca151221db539ae6f9139ac4b534628638 Binary files /dev/null and b/bin_delivery/hermes/final/ramtest/ramtest.bin differ diff --git a/bin_delivery/hermesv0/death-stack-entry/death-stack-entry.bin b/bin_delivery/hermesv0/death-stack-entry/death-stack-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..76a90770d2b2924f709d1516f26cb6a927156d04 Binary files /dev/null and b/bin_delivery/hermesv0/death-stack-entry/death-stack-entry.bin differ diff --git a/bin_delivery/hermesv0/ramtest/ramtest.bin b/bin_delivery/hermesv0/ramtest/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..711e6eca151221db539ae6f9139ac4b534628638 Binary files /dev/null and b/bin_delivery/hermesv0/ramtest/ramtest.bin differ diff --git a/bin_delivery/hermesv1/flight/death-stack-entry.bin b/bin_delivery/hermesv1/flight/death-stack-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..1a5ce010a3e5bb32f20b4a34de4f59f2afac44ab Binary files /dev/null and b/bin_delivery/hermesv1/flight/death-stack-entry.bin differ diff --git a/bin_delivery/hermesv1/flight/flash.sh b/bin_delivery/hermesv1/flight/flash.sh new file mode 100755 index 0000000000000000000000000000000000000000..aeacb9bca99bdccce4dceae3809bbcef1fff7ac9 --- /dev/null +++ b/bin_delivery/hermesv1/flight/flash.sh @@ -0,0 +1,3 @@ +#!/bin/zsh + +st-flash write death-stack-entry.bin 0x8000000 \ No newline at end of file diff --git a/bin_delivery/hermesv1/ramtest/flash.sh b/bin_delivery/hermesv1/ramtest/flash.sh new file mode 100755 index 0000000000000000000000000000000000000000..2ff2c13c3ecfa8d43db01b587c3c4247a47ccfb2 --- /dev/null +++ b/bin_delivery/hermesv1/ramtest/flash.sh @@ -0,0 +1,3 @@ +#!/bin/zsh + +st-flash write ramtest.bin 0x8000000 \ No newline at end of file diff --git a/bin_delivery/hermesv1/ramtest/ramtest.bin b/bin_delivery/hermesv1/ramtest/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..711e6eca151221db539ae6f9139ac4b534628638 Binary files /dev/null and b/bin_delivery/hermesv1/ramtest/ramtest.bin differ diff --git a/bin_delivery/lynx/01_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/01_09_2021/death-stack-x-entry.bin new file mode 100644 index 0000000000000000000000000000000000000000..c2cabaefee395a0047aeb57f1251ff87c3ef0e81 Binary files /dev/null and b/bin_delivery/lynx/01_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/01_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/01_09_2021/death-stack-x-hil-entry.bin new file mode 100644 index 0000000000000000000000000000000000000000..94f428f2556dc634a90d784d2a4040c43c595ff0 Binary files /dev/null and b/bin_delivery/lynx/01_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/01_09_2021/ramtest.bin b/bin_delivery/lynx/01_09_2021/ramtest.bin new file mode 100644 index 0000000000000000000000000000000000000000..0e78678a46015a35e30eb1ab5f0cbdf3195a6944 Binary files /dev/null and b/bin_delivery/lynx/01_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/07_10_2021/calibration-entry.bin b/bin_delivery/lynx/07_10_2021/calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..8afaafc165f7a17df563c02a30817a1ee4b279a6 Binary files /dev/null and b/bin_delivery/lynx/07_10_2021/calibration-entry.bin differ diff --git a/bin_delivery/lynx/07_10_2021/death-stack-x-entry.bin b/bin_delivery/lynx/07_10_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..3cdebf748388c6c171fa707b96307294596ea1e0 Binary files /dev/null and b/bin_delivery/lynx/07_10_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/07_10_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/07_10_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..aed07b8e98dfc05b4ca3b181c2bddb1bf23f73db Binary files /dev/null and b/bin_delivery/lynx/07_10_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/07_10_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/07_10_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..d2f76c591e69806b18fec201253141bfb66ae319 Binary files /dev/null and b/bin_delivery/lynx/07_10_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/07_10_2021/ramtest.bin b/bin_delivery/lynx/07_10_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/07_10_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/09_09_2021/bmx160-calibration-entry.bin b/bin_delivery/lynx/09_09_2021/bmx160-calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca69e32e04d4fc86c8d3f8b319d82cc546ca7701 Binary files /dev/null and b/bin_delivery/lynx/09_09_2021/bmx160-calibration-entry.bin differ diff --git a/bin_delivery/lynx/09_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/09_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..6c65d9f57303075f20d7a2236411967106fee976 Binary files /dev/null and b/bin_delivery/lynx/09_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/09_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/09_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..658d9a03c33fde897cc36d06083af31492257656 Binary files /dev/null and b/bin_delivery/lynx/09_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/09_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/09_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..aad9d8a6378c8fbed073bfcf720b93f6eef2ef27 Binary files /dev/null and b/bin_delivery/lynx/09_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/09_09_2021/ramtest.bin b/bin_delivery/lynx/09_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/09_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/13_09_2021/bmx160-calibration-entry.bin b/bin_delivery/lynx/13_09_2021/bmx160-calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca69e32e04d4fc86c8d3f8b319d82cc546ca7701 Binary files /dev/null and b/bin_delivery/lynx/13_09_2021/bmx160-calibration-entry.bin differ diff --git a/bin_delivery/lynx/13_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/13_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..f630049dd049bf4f8e7e599d3b266adbeccd48e5 Binary files /dev/null and b/bin_delivery/lynx/13_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/13_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/13_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..a434c51ee90bc2bd87add8fa215f1d455193e23e Binary files /dev/null and b/bin_delivery/lynx/13_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/13_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/13_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..ddf65e21ce6a645fd1acc741b5b2a376baf8302e Binary files /dev/null and b/bin_delivery/lynx/13_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/13_09_2021/ramtest.bin b/bin_delivery/lynx/13_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/13_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/14_09_2021/bmx160-calibration-entry.bin b/bin_delivery/lynx/14_09_2021/bmx160-calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca69e32e04d4fc86c8d3f8b319d82cc546ca7701 Binary files /dev/null and b/bin_delivery/lynx/14_09_2021/bmx160-calibration-entry.bin differ diff --git a/bin_delivery/lynx/14_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/14_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..b62fc3a4012b9f6844dc35bc611d3aadc29f4d76 Binary files /dev/null and b/bin_delivery/lynx/14_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/14_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/14_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..5ca4377d3ca7dc9b27b874047f42fea3d0641a15 Binary files /dev/null and b/bin_delivery/lynx/14_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/14_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/14_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..09dcf600e834afa6237d5ff669cbf0db6c270ce7 Binary files /dev/null and b/bin_delivery/lynx/14_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/14_09_2021/ramtest.bin b/bin_delivery/lynx/14_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/14_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/15_09_2021/calibration-entry.bin b/bin_delivery/lynx/15_09_2021/calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca69e32e04d4fc86c8d3f8b319d82cc546ca7701 Binary files /dev/null and b/bin_delivery/lynx/15_09_2021/calibration-entry.bin differ diff --git a/bin_delivery/lynx/15_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/15_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..864c176066218324c8c3d296c1c43a8bde4beaea Binary files /dev/null and b/bin_delivery/lynx/15_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/15_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/15_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..cc73a766d47923dc0200c868675f088aa1325f2e Binary files /dev/null and b/bin_delivery/lynx/15_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/15_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/15_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..09dcf600e834afa6237d5ff669cbf0db6c270ce7 Binary files /dev/null and b/bin_delivery/lynx/15_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/15_09_2021/ramtest.bin b/bin_delivery/lynx/15_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/15_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/16_09_2021/calibration-entry.bin b/bin_delivery/lynx/16_09_2021/calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..713ad03c455a88236ed1b8ac7bf3498029e5ed3b Binary files /dev/null and b/bin_delivery/lynx/16_09_2021/calibration-entry.bin differ diff --git a/bin_delivery/lynx/16_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/16_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..4534de847c602752dde32d77234a75eb1b9bca0d Binary files /dev/null and b/bin_delivery/lynx/16_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/16_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/16_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..2459113feb90775e4a3eebfdedbc4a8cca5a466a Binary files /dev/null and b/bin_delivery/lynx/16_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/16_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/16_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..09dcf600e834afa6237d5ff669cbf0db6c270ce7 Binary files /dev/null and b/bin_delivery/lynx/16_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/16_09_2021/ramtest.bin b/bin_delivery/lynx/16_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/16_09_2021/ramtest.bin differ diff --git a/bin_delivery/lynx/roccaraso_18_09_2021/calibration-entry.bin b/bin_delivery/lynx/roccaraso_18_09_2021/calibration-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..8afaafc165f7a17df563c02a30817a1ee4b279a6 Binary files /dev/null and b/bin_delivery/lynx/roccaraso_18_09_2021/calibration-entry.bin differ diff --git a/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-entry.bin b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..6ea1dfef6b5d259319033e1248aa0c5779bc937d Binary files /dev/null and b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-entry.bin differ diff --git a/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-hil-entry.bin b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-hil-entry.bin new file mode 100755 index 0000000000000000000000000000000000000000..5920ddc1bb1ed76b7f05caf2d52d5d91da92d272 Binary files /dev/null and b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-hil-entry.bin differ diff --git a/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-testsuite.bin b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-testsuite.bin new file mode 100755 index 0000000000000000000000000000000000000000..15aa36bc9cafa412f6030c48376cc75dc3c417af Binary files /dev/null and b/bin_delivery/lynx/roccaraso_18_09_2021/death-stack-x-testsuite.bin differ diff --git a/bin_delivery/lynx/roccaraso_18_09_2021/ramtest.bin b/bin_delivery/lynx/roccaraso_18_09_2021/ramtest.bin new file mode 100755 index 0000000000000000000000000000000000000000..7a288a98220a20c0e0a0aded228b1bef3d89c285 Binary files /dev/null and b/bin_delivery/lynx/roccaraso_18_09_2021/ramtest.bin differ diff --git a/skyward-boardcore b/skyward-boardcore index 3e7f947fa7f9f75796bb289a2272ab9da3bf91e5..b4f10db48e95f5281e6987f768dee363d57ce348 160000 --- a/skyward-boardcore +++ b/skyward-boardcore @@ -1 +1 @@ -Subproject commit 3e7f947fa7f9f75796bb289a2272ab9da3bf91e5 +Subproject commit b4f10db48e95f5281e6987f768dee363d57ce348 diff --git a/src/boards/DeathStack/events/EventData.h b/src/boards/DeathStack/events/EventData.h new file mode 100644 index 0000000000000000000000000000000000000000..5dc3a3ec02d14030c6dd6f32ab6b705bbfc0adcc --- /dev/null +++ b/src/boards/DeathStack/events/EventData.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2019 Skyward Experimental Rocketry + * Author: Luca Erbetta + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include <cstdint> +#include <ostream> +#include <string> + +/** + * @brief Loggable struct for each event posted. + */ +struct EventData +{ + long long timestamp; + uint8_t event; + uint8_t topic; + + static std::string header() { return "timestamp,event,topic\n"; } + + void print(std::ostream& os) const + { + os << timestamp << "," << (int)event << "," << (int)topic << "\n"; + } +}; diff --git a/src/boards/DeathStack/events/EventInjector.h b/src/boards/DeathStack/events/EventInjector.h new file mode 100644 index 0000000000000000000000000000000000000000..c105df210b630c825bddc67be69c5ec6c18f468a --- /dev/null +++ b/src/boards/DeathStack/events/EventInjector.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2019-2021 Skyward Experimental Rocketry + * Author: Luca Erbetta + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include <ActiveObject.h> +#include <DeathStack.h> +#include <events/EventBroker.h> +#include <events/Events.h> + +#include <iostream> +#include <sstream> +#include <string> + +using std::string; +using std::stringstream; +class EventInjector : public ActiveObject +{ +public: +protected: + void run() override + { + using namespace std; + using namespace DeathStackBoard; + + int ev, topic; + for (;;) + { + cout << "Insert Event & Topic:\n"; + + string temp; + getline(cin, temp); + stringstream(temp) >> ev >> topic; + + switch (ev) + { + // case EV_TC_SET_DPL_ALTITUDE: + // { + // float in; + // cout << "Payload:\n"; + // getline(cin, temp); + // stringstream(temp) >> in; + + // DeathStack::getInstance()->ada->setDeploymentAltitude(in); + // break; + // } + // case EV_TC_SET_REFERENCE_ALTITUDE: + // { + // float in; + // cout << "Payload:\n"; + // getline(cin, temp); + // stringstream(temp) >> in; + + // DeathStack::getInstance()->ada->setReferenceAltitude(in); + // break; + // } + // case EV_TC_SET_REFERENCE_TEMP: + // { + // float in; + // cout << "Payload:\n"; + // getline(cin, temp); + // stringstream(temp) >> in; + + // DeathStack::getInstance()->ada->setReferenceTemperature(in); + // break; + // } + default: + { + sEventBroker->post({(uint8_t)ev}, topic); + break; + } + } + } + } + +private: +}; \ No newline at end of file