This commit is contained in:
parent
8c8c5b4171
commit
bfae0f53fa
@ -1,14 +1,17 @@
|
|||||||
# Events
|
# Events
|
||||||
|
|
||||||
Events can be an extremely important mechanism used for remote systems to monitor unexpected
|
Events are an important mechanism used for remote systems to monitor unexpected
|
||||||
or expected anomalies and events occuring on these systems. They are oftentimes tied to
|
or expected anomalies and events occuring on these systems.
|
||||||
|
|
||||||
|
One common use case for events on remote systems is to offer a light-weight publish-subscribe
|
||||||
|
mechanism and IPC mechanism for software and hardware events which are also packaged as telemetry
|
||||||
|
(TM) or can trigger a system response. They can also be tied to
|
||||||
Fault Detection, Isolation and Recovery (FDIR) operations, which need to happen autonomously.
|
Fault Detection, Isolation and Recovery (FDIR) operations, which need to happen autonomously.
|
||||||
|
|
||||||
Events can also be used as a convenient Inter-Process Communication (IPC) mechansism, which is
|
The PUS Service 5 standardizes how the ground interface for events might look like, but does not
|
||||||
also observable for the Ground segment. The PUS Service 5 standardizes how the ground interface
|
specify how other software components might react to those events. There is the PUS Service 19,
|
||||||
for events might look like, but does not specify how other software components might react
|
which might be used for that purpose, but the event components recommended by this framework do not
|
||||||
to those events. There is the PUS Service 19, which might be used for that purpose, but the
|
rely on the present of this service.
|
||||||
event components recommended by this framework do not really need this service.
|
|
||||||
|
|
||||||
The following images shows how the flow of events could look like in a system where components
|
The following images shows how the flow of events could look like in a system where components
|
||||||
can generate events, and where other system components might be interested in those events:
|
can generate events, and where other system components might be interested in those events:
|
||||||
|
@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v0.2.0-rc.5] 2024-04-23
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Removed `MpscEventReceiver`, the `EventReceiveProvider` trait is implemented directly
|
||||||
|
on `mpsc::Receiver<EventMessage<Event>>`
|
||||||
|
- Renamed `PusEventDispatcher` to `PusEventTmCreatorWithMap`.
|
||||||
|
- Renamed `DefaultPusEventU32Dispatcher` to `DefaultPusEventU32EventCreator`.
|
||||||
|
- Renamed `PusEventMgmtBackendProvider` renamed to `PusEventReportingMap`.
|
||||||
|
|
||||||
# [v0.2.0-rc.4] 2024-04-23
|
# [v0.2.0-rc.4] 2024-04-23
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
//! Event management and forwarding
|
//! Event management and forwarding
|
||||||
//!
|
//!
|
||||||
//! This module provides components to perform event routing. The most important component for this
|
|
||||||
//! task is the [EventManager]. It receives all events and then routes them to event subscribers
|
|
||||||
//! where appropriate. One common use case for satellite systems is to offer a light-weight
|
|
||||||
//! publish-subscribe mechanism and IPC mechanism for software and hardware events which are also
|
|
||||||
//! packaged as telemetry (TM) or can trigger a system response.
|
|
||||||
//!
|
|
||||||
//! It is recommended to read the
|
//! It is recommended to read the
|
||||||
//! [sat-rs book chapter](https://absatsw.irs.uni-stuttgart.de/projects/sat-rs/book/events.html)
|
//! [sat-rs book chapter](https://absatsw.irs.uni-stuttgart.de/projects/sat-rs/book/events.html)
|
||||||
//! about events first:
|
//! about events first.
|
||||||
|
//!
|
||||||
|
//! This module provides components to perform event routing. The most important component for this
|
||||||
|
//! task is the [EventManager]. It receives all events and then routes them to event subscribers
|
||||||
|
//! where appropriate.
|
||||||
//!
|
//!
|
||||||
//! The event manager has a listener table abstracted by the [ListenerMapProvider], which maps
|
//! The event manager has a listener table abstracted by the [ListenerMapProvider], which maps
|
||||||
//! listener groups identified by [ListenerKey]s to a [listener ID][ComponentId].
|
//! listener groups identified by [ListenerKey]s to a [listener ID][ComponentId].
|
||||||
|
@ -28,7 +28,7 @@ pub use heapless_mod::*;
|
|||||||
/// structure to track disabled events. A more primitive and embedded friendly
|
/// 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
|
/// solution could track this information in a static or pre-allocated list which contains
|
||||||
/// the disabled events.
|
/// the disabled events.
|
||||||
pub trait PusEventReportingMap<Event: GenericEvent> {
|
pub trait PusEventReportingMapProvider<Event: GenericEvent> {
|
||||||
type Error;
|
type Error;
|
||||||
|
|
||||||
fn event_enabled(&self, event: &Event) -> bool;
|
fn event_enabled(&self, event: &Event) -> bool;
|
||||||
@ -56,7 +56,7 @@ pub mod heapless_mod {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<const N: usize, Provider: GenericEvent> PusEventReportingMap<Provider>
|
impl<const N: usize, Provider: GenericEvent> PusEventReportingMapProvider<Provider>
|
||||||
for HeaplessPusMgmtBackendProvider<N, Provider>
|
for HeaplessPusMgmtBackendProvider<N, Provider>
|
||||||
{
|
{
|
||||||
type Error = ();
|
type Error = ();
|
||||||
@ -113,7 +113,7 @@ pub mod alloc_mod {
|
|||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
/// Default backend provider which uses a hash set as the event reporting status container
|
/// Default backend provider which uses a hash set as the event reporting status container
|
||||||
/// like mentioned in the example of the [PusEventMgmtBackendProvider] documentation.
|
/// like mentioned in the example of the [PusEventReportingMapProvider] documentation.
|
||||||
///
|
///
|
||||||
/// This provider is a good option for host systems or larger embedded systems where
|
/// 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.
|
/// the expected occasional memory allocation performed by the [HashSet] is not an issue.
|
||||||
@ -129,8 +129,8 @@ pub mod alloc_mod {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Event: GenericEvent + PartialEq + Eq + Hash + Copy + Clone> PusEventReportingMap<Event>
|
impl<Event: GenericEvent + PartialEq + Eq + Hash + Copy + Clone>
|
||||||
for DefaultPusEventReportingMap<Event>
|
PusEventReportingMapProvider<Event> for DefaultPusEventReportingMap<Event>
|
||||||
{
|
{
|
||||||
type Error = ();
|
type Error = ();
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ pub mod alloc_mod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct PusEventTmCreatorWithMap<
|
pub struct PusEventTmCreatorWithMap<
|
||||||
ReportingMap: PusEventReportingMap<Event>,
|
ReportingMap: PusEventReportingMapProvider<Event>,
|
||||||
Event: GenericEvent,
|
Event: GenericEvent,
|
||||||
EventTmHook: EventTmHookProvider = DummyEventHook,
|
EventTmHook: EventTmHookProvider = DummyEventHook,
|
||||||
> {
|
> {
|
||||||
@ -158,7 +158,7 @@ pub mod alloc_mod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
ReportingMap: PusEventReportingMap<Event>,
|
ReportingMap: PusEventReportingMapProvider<Event>,
|
||||||
Event: GenericEvent,
|
Event: GenericEvent,
|
||||||
EventTmHook: EventTmHookProvider,
|
EventTmHook: EventTmHookProvider,
|
||||||
> PusEventTmCreatorWithMap<ReportingMap, Event, EventTmHook>
|
> PusEventTmCreatorWithMap<ReportingMap, Event, EventTmHook>
|
||||||
@ -226,7 +226,7 @@ pub mod alloc_mod {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<ReportingMap: PusEventReportingMap<EventU32>>
|
impl<ReportingMap: PusEventReportingMapProvider<EventU32>>
|
||||||
PusEventTmCreatorWithMap<ReportingMap, EventU32>
|
PusEventTmCreatorWithMap<ReportingMap, EventU32>
|
||||||
{
|
{
|
||||||
pub fn enable_tm_for_event_with_sev<Severity: HasSeverity>(
|
pub fn enable_tm_for_event_with_sev<Severity: HasSeverity>(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user