diff --git a/fsrc-core/src/pus/verification.rs b/fsrc-core/src/pus/verification.rs index da56f69..5a35a12 100644 --- a/fsrc-core/src/pus/verification.rs +++ b/fsrc-core/src/pus/verification.rs @@ -197,12 +197,31 @@ pub struct StateAccepted; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct StateStarted; +#[derive(Debug, Eq, PartialEq)] pub enum StateToken { None(StateNone), Accepted(StateAccepted), Started(StateStarted), } +impl From for StateToken { + fn from(t: StateNone) -> Self { + StateToken::None(t) + } +} + +impl From for StateToken { + fn from(t: StateAccepted) -> Self { + StateToken::Accepted(t) + } +} + +impl From for StateToken { + fn from(t: StateStarted) -> Self { + StateToken::Started(t) + } +} + impl VerificationToken { fn new(req_id: RequestId) -> VerificationToken { VerificationToken { diff --git a/fsrc-example/src/bin/obsw/pus.rs b/fsrc-example/src/bin/obsw/pus.rs index f4c59e3..4ab47b4 100644 --- a/fsrc-example/src/bin/obsw/pus.rs +++ b/fsrc-example/src/bin/obsw/pus.rs @@ -63,6 +63,8 @@ impl PusServiceProvider for PusReceiver { drop(reporter); if service == 17 { self.handle_test_service(pus_tc, accepted_token); + } else if service == 5 { + // TODO: Send message to event manager here } Ok(()) }