Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
MessageFormat.c
Go to the documentation of this file.
1#include "../../Inc/Utils/MessageFormat.h"
2#include <stdio.h>
3#include <stdarg.h>
4
5void sendMessage(const char* sender, MessageType type, const char* format, ...) {
6 const char* type_strings[] = {
7 "SENSOR_VALUE",
8 "OUTPUT_VALUE",
9 "SYSTEM_STATUS",
10 "WARNING",
11 "ERROR",
12 "DEBUG",
13 "CAN_TX",
14 "CAN_RX",
15 "TIMER_STATS",
16 "CONFIG"
17 };
18
19 printf("Sender:%s;InfoType:%s;Content:", sender, type_strings[type]);
20
21 va_list args;
22 va_start(args, format);
23 vprintf(format, args);
24 va_end(args);
25
26 printf("\r\n");
27}
void sendMessage(const char *sender, MessageType type, const char *format,...)
Definition: MessageFormat.c:5
MessageType
Definition: MessageFormat.h:8