|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
IPC Publish-Subscribe Pattern Example. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <pthread.h>#include "rte/status.h"#include "rte/log.h"#include "rte/ipc/rte_ipc_pubsub.h"Go to the source code of this file.
Data Structures | |
| struct | track_status_t |
| Track status event (published to all subscribers). More... | |
Macros | |
| #define | TRACK_EMPTY 0 |
| #define | TRACK_OCCUPIED 1 |
| #define | TRACK_UNKNOWN 2 |
Functions | |
| static void * | track_publisher_thread (void *arg) |
| Simulate track status changes and publish. | |
| static void * | signal_manager_thread (void *arg) |
| Signal Manager - Reacts to track status by updating signals. | |
| static void * | speed_manager_thread (void *arg) |
| Speed Manager - Reacts to track status by updating speed limits. | |
| static void * | route_manager_thread (void *arg) |
| Route Manager - Reacts to track status by planning routes. | |
| int | main (void) |
IPC Publish-Subscribe Pattern Example.
Demonstrates one-to-many event broadcasting:
Architecture:
All subscribers receive same message, act independently.
Definition in file ipc-pubsub-example.c.
| #define TRACK_EMPTY 0 |
Definition at line 47 of file ipc-pubsub-example.c.
| #define TRACK_OCCUPIED 1 |
Definition at line 48 of file ipc-pubsub-example.c.
| #define TRACK_UNKNOWN 2 |
Definition at line 49 of file ipc-pubsub-example.c.
|
static |
Simulate track status changes and publish.
Definition at line 58 of file ipc-pubsub-example.c.
|
static |
Signal Manager - Reacts to track status by updating signals.
Definition at line 99 of file ipc-pubsub-example.c.
|
static |
Speed Manager - Reacts to track status by updating speed limits.
Definition at line 136 of file ipc-pubsub-example.c.
|
static |
Route Manager - Reacts to track status by planning routes.
Definition at line 166 of file ipc-pubsub-example.c.
| int main | ( | void | ) |
Definition at line 202 of file ipc-pubsub-example.c.