RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
ab_gp_proc_tsr.c File Reference

ERTMS Subset-026 §5.10 Temporary Speed Restriction (TSR) Procedure Implementation. More...

#include "ab_gp_proc_tsr.h"
#include "rte/oal/memory/rte_mem_util.h"
#include "rte/utils/cast/rte_cast.h"
Include dependency graph for ab_gp_proc_tsr.c:

Go to the source code of this file.

Functions

void ab_gp_proc_tsr_init (ab_gp_ertms_train_context_t *ctx)
 Initializes the TSR records for a train context.
bool ab_gp_proc_tsr_add (ab_gp_ertms_train_context_t *ctx, uint8_t nid_tsr, uint32_t v_tsr_kmh, uint32_t d_start_m, uint32_t d_end_m)
 Adds a new Temporary Speed Restriction to the train's supervised path.
bool ab_gp_proc_tsr_remove (ab_gp_ertms_train_context_t *ctx, uint8_t nid_tsr)
 Removes an active Temporary Speed Restriction from the train's path.
bool ab_gp_proc_tsr_generate_packet_65 (const ab_gp_ertms_train_context_t *ctx, uint8_t nid_tsr, rbc_packet_65_tsr_t *out_p65)
 Generates an ERTMS Packet 65 (TSR) payload for transmission in Msg 3 / Msg 24.
bool ab_gp_proc_tsr_generate_packet_66 (uint8_t nid_tsr, rbc_packet_66_tsr_revoke_t *out_p66)
 Generates an ERTMS Packet 66 (TSR Revocation) payload.
uint8_t ab_gp_proc_tsr_get_active_count (const ab_gp_ertms_train_context_t *ctx)
 Returns the number of currently active TSRs for this train.

Detailed Description

ERTMS Subset-026 §5.10 Temporary Speed Restriction (TSR) Procedure Implementation.

Implements SIL 4 C99 Temporary Speed Restriction management, Packet 65 (TSR) generation, Packet 66 (TSR Revocation) generation, and track segment speed supervision for ERTMS Level 2 RBC operation.

Definition in file ab_gp_proc_tsr.c.

Function Documentation

◆ ab_gp_proc_tsr_init()

void ab_gp_proc_tsr_init ( ab_gp_ertms_train_context_t * ctx)

Initializes the TSR records for a train context.

Parameters
[in,out]ctxTrain ERTMS context.

Definition at line 15 of file ab_gp_proc_tsr.c.

◆ ab_gp_proc_tsr_add()

bool ab_gp_proc_tsr_add ( ab_gp_ertms_train_context_t * ctx,
uint8_t nid_tsr,
uint32_t v_tsr_kmh,
uint32_t d_start_m,
uint32_t d_end_m )

Adds a new Temporary Speed Restriction to the train's supervised path.

Parameters
[in,out]ctxTrain ERTMS context.
[in]nid_tsrUnique TSR identifier (1..255).
[in]v_tsr_kmhRestricted maximum speed (km/h).
[in]d_start_mStart location in meters relative to active LRBG.
[in]d_end_mEnd location in meters relative to active LRBG.
Returns
true if TSR was added, false if table full or invalid args.

Definition at line 35 of file ab_gp_proc_tsr.c.

◆ ab_gp_proc_tsr_remove()

bool ab_gp_proc_tsr_remove ( ab_gp_ertms_train_context_t * ctx,
uint8_t nid_tsr )

Removes an active Temporary Speed Restriction from the train's path.

Parameters
[in,out]ctxTrain ERTMS context.
[in]nid_tsrTSR identifier to revoke.
Returns
true if TSR was found and removed, false otherwise.

Definition at line 81 of file ab_gp_proc_tsr.c.

◆ ab_gp_proc_tsr_generate_packet_65()

bool ab_gp_proc_tsr_generate_packet_65 ( const ab_gp_ertms_train_context_t * ctx,
uint8_t nid_tsr,
rbc_packet_65_tsr_t * out_p65 )

Generates an ERTMS Packet 65 (TSR) payload for transmission in Msg 3 / Msg 24.

Parameters
[in]ctxTrain ERTMS context.
[in]nid_tsrTSR identifier.
[out]out_p65Destination Packet 65 structure.
Returns
true on success, false if TSR not found.

Definition at line 107 of file ab_gp_proc_tsr.c.

◆ ab_gp_proc_tsr_generate_packet_66()

bool ab_gp_proc_tsr_generate_packet_66 ( uint8_t nid_tsr,
rbc_packet_66_tsr_revoke_t * out_p66 )

Generates an ERTMS Packet 66 (TSR Revocation) payload.

Parameters
[in]nid_tsrTSR identifier to revoke.
[out]out_p66Destination Packet 66 structure.
Returns
true on success.

Definition at line 138 of file ab_gp_proc_tsr.c.

◆ ab_gp_proc_tsr_get_active_count()

uint8_t ab_gp_proc_tsr_get_active_count ( const ab_gp_ertms_train_context_t * ctx)

Returns the number of currently active TSRs for this train.

Parameters
[in]ctxTrain ERTMS context.
Returns
Number of active TSRs (0..RBC_MAX_TSR_ITEMS).

Definition at line 151 of file ab_gp_proc_tsr.c.