Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions
MessageFormat.c File Reference
#include "../../Inc/Utils/MessageFormat.h"
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for MessageFormat.c:

Go to the source code of this file.

Functions

void sendMessage (const char *sender, MessageType type, const char *format,...)
 

Function Documentation

◆ sendMessage()

void sendMessage ( const char *  sender,
MessageType  type,
const char *  format,
  ... 
)

Definition at line 5 of file MessageFormat.c.

5 {
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}
Here is the caller graph for this function: