ArduinoMega2560_SPI 1.0
Cargando...
Buscando...
Nada coincide
msg.h
Ir a la documentación de este archivo.
1#ifndef MESSAGE_RELEASE_H
2#define MESSAGE_RELEASE_H
3
4#include <Arduino.h>
6
7/**
8 * @brief Prints an enriched log message to the serial monitor.
9 *
10 * This function should be defined in the corresponding source (.cpp) file.
11 * It generates a structured output that includes:
12 * - Compilation date and time
13 * - Source file from which it is called
14 * - Name of the calling function
15 * - Custom message
16 *
17 * Output format:
18 * [date time] file::function ➤ message
19 *
20 * Example:
21 * [Aug 7 2025 01:23:00] main.cpp::setup ➤ System initialization...
22 *
23 * @param message Custom text to be printed
24 * @param file Source file name (__FILE__)
25 * @param function Name of the calling function (__FUNCTION__)
26 * @param date Compilation date (__DATE__)
27 * @param time Compilation time (__TIME__)
28 */
29void standardMessage(const char* message,
30 const char* file,
31 const char* function,
32 const char* date,
33 const char* time);
34
35
36/**
37 * Prints a centered header with decorative lines above/below.
38 * This is a reduced version without metadata, ideal for section titles.
39 *
40 * @param message The title text to display centered.
41 * @param width Total width of the decorative line (default: 200).
42 * @param deco Decorative character to use (default: '-').
43 */
44void standardHeader(const char* message,
45 uint16_t width = 200,
46 char deco = '-');
47
48
49/**
50 * @brief Prints a decorated header with centered text and padding on both sides.
51 *
52 * This function builds a single line consisting of a combined text
53 * that includes the message, file, function, date, and time, surrounded
54 * by decorative characters on the left and right to achieve a total line width
55 * specified by the user.
56 *
57 * Output format example:
58 * ----- Message | file | function | date time -----
59 *
60 * @param message Main text or description to display.
61 * @param file File path or source file name.
62 * @param function Name of the function where this is called.
63 * @param date Compilation date (recommended: __DATE__).
64 * @param time Compilation time (recommended: __TIME__).
65 * @param width Total width of the line (default: 120).
66 * @param deco Decorative character (default: '-').
67 *
68 * @note The number of decorative characters is automatically adjusted
69 * to keep the text centered within the given width.
70 */
71void standardHeaderFull(const char* message,
72 const char* file,
73 const char* function,
74 const char* date,
75 const char* time,
76 uint16_t width = 120,
77 char deco = '-');
78
79
80/**
81 * @brief Prints an enriched error message to the serial monitor, including contextual information.
82 *
83 * This function generates a structured output that helps identify the origin of runtime errors.
84 * The output includes:
85 * - Compilation date and time
86 * - Source file name
87 * - Function name from which it is invoked
88 * - Line number where the function was called
89 * - Custom error message
90 *
91 * Output format:
92 * [date time] file::function (Line N) ❌ ERROR ➤ message
93 *
94 * Example output:
95 * [Aug 7 2025 01:23:00] sensor.cpp::readSensor (Line 42) ❌ ERROR ➤ Failed to initialize sensor
96 *
97 * @param message Description of the specific error
98 * @param file Source file name (__FILE__)
99 * @param function Function name where the error was detected (__FUNCTION__)
100 * @param date Compilation date (__DATE__)
101 * @param time Compilation time (__TIME__)
102 * @param line Line number in the file where the function is invoked (__LINE__)
103 */
104void standardErrorMessage(const char* message, const char* file, const char* function, const char* date, const char* time, int line);
105
106
107/**
108 * @brief Displays the current system configuration status on the serial monitor.
109 *
110 * This function prints the current values of the fields defined in the
111 * configuracionMain structure, such as debug mode and LED project status,
112 * in a user-friendly format to facilitate system diagnostics or verification.
113 *
114 * @param configuration Structure containing the main system configuration.
115 */
116void showConfigurationMessage(const configuracionMain& configuration);
117
118
119/**
120 * @brief Prints firmware version details to the serial monitor.
121 *
122 * Displays firmware and application information (version, name, date, author)
123 * defined by macros in a clear format for easy verification.
124 */
125void printVersion(const char* fwVersion,
126 const char* fwName,
127 const char* fwDate,
128 const char* fwAuthor,
129 const char* appVersion,
130 const char* appName,
131 const char* appDate);
132
133#endif // MESSAGE_RELEASE_H
void standardMessage(const char *message, const char *file, const char *function, const char *date, const char *time)
Prints an enriched log message to the serial monitor.
Definition msg.cpp:15
void standardErrorMessage(const char *message, const char *file, const char *function, const char *date, const char *time, int line)
Prints an enriched error message to the serial monitor, including contextual information.
Definition msg.cpp:177
void standardHeaderFull(const char *message, const char *file, const char *function, const char *date, const char *time, uint16_t width=120, char deco='-')
Prints a decorated header with centered text and padding on both sides.
Definition msg.cpp:121
void standardHeader(const char *message, uint16_t width=200, char deco='-')
Imprime un encabezado decorativo con el mensaje centrado.
Definition msg.cpp:72
void printVersion(const char *fwVersion, const char *fwName, const char *fwDate, const char *fwAuthor, const char *appVersion, const char *appName, const char *appDate)
Prints firmware version details to the serial monitor.
Definition msg.cpp:248
void showConfigurationMessage(const configuracionMain &configuration)
Displays the current system configuration status on the serial monitor.
Definition msg.cpp:203
Main configuration structure for the project.
Definition config.h:13