Skip to main content

Module dcc_entity

Module dcc_entity 

Source
Expand description

DCC entity: couples a CbrProvider (access layer) with a DCC algorithm and the facilities layer.

On each evaluation (every 200 ms, aligned to UTC-modulo-200 ms boundaries per ETSI TS 102 687 V1.2.1 clause 5.2) the entity:

  1. polls the CBR provider;
  2. runs the reactive (clause 5.3) or adaptive (clause 5.4) algorithm;
  3. converts the result into T_GenCam_DCC, the minimum CAM generation interval provided to the CA basic service (ETSI TS 103 900 §6.1.3), bounded to [T_GenCamMin, T_GenCamMax] = [100, 1000] ms;
  4. notifies every registered listener with the new T_GenCam_DCC.

Conversion:

  • Reactive: T_GenCam_DCC = T_off of the current state (Annex A tables).
  • Adaptive: T_GenCam_DCC = T_on / delta (gate interval of equation B.1).

Mirrors flexstack/management/dcc_entity.py.

§Example

use rustflexstack::management::{DccEntity, DccMode, SharedCbr};

let cbr = SharedCbr::new();
let mut dcc = DccEntity::new(DccMode::reactive(), Box::new(cbr.clone()));
// let ctm = ca_service.cam_transmission_management.clone();
// dcc.add_t_gen_cam_dcc_listener(move |ms| ctm.set_t_gen_cam_dcc(ms));
let handle = dcc.spawn();
cbr.report(0.45); // from the access layer
handle.stop();

Structs§

DccEntity
DCC entity of the ITS-S management layer.
DccEntityHandle
Handle to a DCC entity running on a background thread.
DccEntityOutput
Result of one DCC entity evaluation.

Enums§

DccMode
DCC algorithm selection.

Constants§

DCC_EVALUATION_PERIOD_MS
DCC evaluation period in milliseconds (clause 5.2).
T_GEN_CAM_DCC_MAX_MS
Upper bound of T_GenCam_DCC (T_GenCamMax, ETSI TS 103 900 §6.1.3) [ms].
T_GEN_CAM_DCC_MIN_MS
Lower bound of T_GenCam_DCC (T_GenCamMin, ETSI TS 103 900 §6.1.3) [ms].

Functions§

clamp_t_gen_cam_dcc
Bound an interval in ms to [T_GEN_CAM_DCC_MIN_MS, T_GEN_CAM_DCC_MAX_MS].