diff options
Diffstat (limited to 'aufgabe4/monitor.c')
| -rw-r--r-- | aufgabe4/monitor.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/aufgabe4/monitor.c b/aufgabe4/monitor.c index b631e59..e2bf015 100644 --- a/aufgabe4/monitor.c +++ b/aufgabe4/monitor.c @@ -1,18 +1,35 @@ /* * vim:ts=4:sw=4:expandtab + * + * © 2010 Michael Stapelberg * */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> +#include "queue.h" + +/* + * Monitor-Prozess. Gibt die empfangenen Daten aus. + * + */ void monitor() { - printf("monitor started\n"); for (;;) { + /* Wir warten auf Nachrichten des CONV-Prozesses */ + while (queue_get_dir() != D_STAT_TO_MON) + usleep(1); + + uint8_t data = queue_get_data(); + printf("Empfangenes Datum: %d\n", data); + fflush(stdout); } } +/* + * Cleanup-Funktion. Beendet den Prozess. + * + */ void monitor_cleanup() { - printf("monitor cleanup\n"); _exit(EXIT_SUCCESS); } |
