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
voter.c File Reference

2oo2 Voter - Performs vital voting per site More...

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

Go to the source code of this file.

Data Structures

struct  train_command_t
struct  shared_state_t

Functions

 __attribute__ ((aligned(64)))
int main (int argc, char *argv[])

Variables

 voted_result_t

Detailed Description

2oo2 Voter - Performs vital voting per site

Independent voter process that:

  1. Reads commands from Process A and B (vital channels)
  2. Compares them (2oo2 logic)
  3. Generates vote results
  4. Writes to Process C (service channel)
  5. Enforces timeout and error thresholds

In production: Separate voter per site, with deterministic timing

Definition in file voter.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (aligned(64)) )

Definition at line 45 of file voter.c.

◆ main()

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

Definition at line 108 of file voter.c.

Variable Documentation

◆ voted_result_t

voted_result_t

Definition at line 53 of file voter.c.