grblHAL core  20250320
report.h
Go to the documentation of this file.
1 /*
2  report.h - reporting and messaging methods
3 
4  Part of grblHAL
5 
6  Copyright (c) 2018-2024 Terje Io
7  Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
8 
9  Grbl is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  Grbl is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with Grbl. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef _REPORT_H_
24 #define _REPORT_H_
25 
26 #include "system.h"
27 #include "ngc_params.h"
28 
29 typedef enum {
35 
36 // Initialize reporting subsystem
37 void report_init (void);
38 void report_init_fns (void);
39 
40 // Prints feedback message, typically from gcode.
41 void report_message (const char *msg, message_type_t type);
42 
43 // Message helper to be run as foreground task.
44 void report_plain (void *message);
45 
46 // Message helper to be run as foreground task.
47 void report_info (void *message);
48 
49 // Message helper to be run as foreground task.
50 void report_warning (void *message);
51 
52 // Prints Grbl help.
53 status_code_t report_help (char *args);
54 
55 void report_plugin (const char *name, const char *version);
56 
57 // Prints Grbl settings
58 void report_grbl_settings (bool all, void *data);
59 
60 // Prints Grbl setting
62 
63 // Prints an echo of the pre-parsed line received right before execution.
64 void report_echo_line_received (char *line);
65 
66 // Prints realtime status report.
67 void report_realtime_status (void);
68 
69 // Prints recorded probe position.
70 void report_probe_parameters (void);
71 
72 // Prints current tool offsets.
73 void report_tool_offsets (void);
74 
75 #if NGC_PARAMETERS_ENABLE
76 
77 // Prints NIST/LinuxCNC NGC parameter value
79 
80 // Prints named LinuxCNC NGC parameter value
82 
83 #endif
84 
85 // Prints Grbl NGC parameters (coordinate offsets, probe).
86 void report_ngc_parameters (void);
87 
88 // Prints current g-code parser mode state.
89 void report_gcode_modes (void);
90 
91 // Prints startup line when requested and executed.
92 void report_startup_line (uint8_t n, char *line);
93 void report_execute_startup_message (char *line, status_code_t status_code);
94 
95 // Prints build info and user info.
96 void report_build_info (char *line, bool extended);
97 
98 status_code_t report_alarm_details (bool grbl_format);
99 status_code_t report_error_details (bool grbl_format);
100 status_code_t report_setting_group_details (bool by_id, char *prefix);
102 #ifndef NO_SETTINGS_DESCRIPTIONS
104 #endif
105 
109 
110 // Prints spindle data (encoder pulse and index count, angular position).
111 status_code_t report_spindle_data (sys_state_t state, char *args);
112 
113 // Prints pin assignments.
114 status_code_t report_pins (sys_state_t state, char *args);
115 
116 status_code_t report_pin_states (sys_state_t state, char *args);
117 
118 // Prints registered spindles.
119 status_code_t report_spindles (bool machine_readable);
120 
121 // Prints current stepper (motor) status.
123 
124 // Prints current RTC datetime in ISO8601 format (when available)
126 
127 // Prints current PID log.
128 void report_pid_log (void);
129 
130 #endif
status_code_t
Definition: errors.h:30
message_type_t
Definition: messages.h:53
uint16_t ngc_param_id_t
Definition: ngc_params.h:39
settings_format_t
Definition: report.h:29
@ SettingsFormat_MachineReadable
Definition: report.h:30
@ SettingsFormat_HumanReadable
Definition: report.h:31
@ SettingsFormat_Grbl
Definition: report.h:32
@ SettingsFormat_grblHAL
Definition: report.h:33
void report_plain(void *message)
Definition: report.c:278
void report_ngc_parameters(void)
Definition: report.c:598
void report_execute_startup_message(char *line, status_code_t status_code)
Definition: report.c:822
status_code_t report_spindles(bool machine_readable)
Definition: report.c:2581
void report_init(void)
Definition: report.c:202
status_code_t report_last_signals_event(sys_state_t state, char *args)
Definition: report.c:2166
void report_grbl_settings(bool all, void *data)
Definition: report.c:469
status_code_t report_pin_states(sys_state_t state, char *args)
Definition: report.c:2449
status_code_t report_error_details(bool grbl_format)
Definition: report.c:2036
void report_tool_offsets(void)
Definition: report.c:548
void report_echo_line_received(char *line)
Definition: report.c:1113
void report_gcode_modes(void)
Definition: report.c:691
void report_plugin(const char *name, const char *version)
Definition: report.c:331
void report_probe_parameters(void)
Definition: report.c:525
status_code_t report_current_home_signal_state(sys_state_t state, char *args)
Definition: report.c:2196
void report_init_fns(void)
Definition: report.c:2680
status_code_t report_alarm_details(bool grbl_format)
Definition: report.c:1976
void report_pid_log(void)
Definition: report.c:2644
status_code_t report_named_ngc_parameter(char *arg)
Definition: report.c:579
status_code_t report_grbl_setting(setting_id_t id, void *data)
Definition: report.c:437
void report_message(const char *msg, message_type_t type)
Definition: report.c:244
status_code_t report_time(void)
Definition: report.c:2469
void report_startup_line(uint8_t n, char *line)
Definition: report.c:815
void report_warning(void *message)
Definition: report.c:290
void report_realtime_status(void)
Definition: report.c:1139
void report_info(void *message)
Definition: report.c:284
status_code_t report_setting_description(settings_format_t format, setting_id_t id)
Definition: report.c:1926
status_code_t report_spindle_data(sys_state_t state, char *args)
Definition: report.c:2216
void report_build_info(char *line, bool extended)
Definition: report.c:831
status_code_t report_current_limit_state(sys_state_t state, char *args)
Definition: report.c:2182
status_code_t report_pins(sys_state_t state, char *args)
Definition: report.c:2306
status_code_t report_settings_details(settings_format_t format, setting_id_t setting, setting_group_t group)
Definition: report.c:1906
status_code_t report_help(char *args)
Definition: report.c:370
status_code_t report_setting_group_details(bool by_id, char *prefix)
Definition: report.c:2113
status_code_t report_stepper_status(sys_state_t state, char *args)
Definition: report.c:2611
status_code_t report_ngc_parameter(ngc_param_id_t id)
Definition: report.c:562
setting_id_t
Definition: settings.h:46
setting_group_t
Definition: settings.h:885
uint_fast16_t sys_state_t
See sys_state.
Definition: system.h:147