Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
process_a.c File Reference

EAST Site - Process A (Vital Channel A - CPU0). More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <time.h>
Include dependency graph for process_a.c:

Go to the source code of this file.

Data Structures

struct  train_command_t
struct  shared_state_t
struct  train_db_entry_t

Macros

#define TRAIN_COUNT   (sizeof(trains) / sizeof(trains[0]))

Functions

 __attribute__ ((aligned(64)))
static uint32_t crc32_checksum (const uint8_t *data, uint32_t len)
static train_command_t compute_train_command (uint32_t train_id, uint32_t position)
int main (int argc, char *argv[])

Variables

static train_db_entry_t trains []

Detailed Description

EAST Site - Process A (Vital Channel A - CPU0).

Standby/Backup computation channel for ERTMS RBC East (Barcelona). Mirrors WEST site but remains standby until promoted.

In STANDBY mode:

  • Computes commands independently (for synchronization)
  • Does not produce final output commands
  • Ready to take over if WEST fails

In ONLINE mode (after failover):

  • Same as WEST Process A
  • Becomes primary computation channel

Definition in file process_a.c.

Macro Definition Documentation

◆ TRAIN_COUNT

#define TRAIN_COUNT   (sizeof(trains) / sizeof(trains[0]))

Definition at line 70 of file process_a.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (aligned(64)) )

Definition at line 52 of file process_a.c.

◆ crc32_checksum()

uint32_t crc32_checksum ( const uint8_t * data,
uint32_t len )
static

Definition at line 76 of file process_a.c.

◆ compute_train_command()

train_command_t compute_train_command ( uint32_t train_id,
uint32_t position )
static

Definition at line 90 of file process_a.c.

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 126 of file process_a.c.

Variable Documentation

◆ trains

train_db_entry_t trains[]
static
Initial value:
= {
{ .train_id = 101, .position = 500 },
{ .train_id = 102, .position = 2500 },
{ .train_id = 103, .position = 7500 },
}

Definition at line 64 of file process_a.c.