Skip to content

Commit 01afe92

Browse files
committed
GCS_MAVLink: Add _MSG_NTC_LVL parameter to filter text messages by severity
1 parent 7f8d0d3 commit 01afe92

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

libraries/GCS_MAVLink/GCS.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ const AP_Param::GroupInfo GCS::var_info[] {
234234
// @Path: GCS_MAVLink_Parameters.cpp
235235
AP_SUBGROUPVARPTR(_chan[31], "32", 42, GCS, _chan_var_info[31]),
236236
#endif
237+
// @Param: _MSG_NTC_LVL
238+
// @DisplayName: Message Notification Level
239+
// @Description: Filter level for GCS text messages. Only messages with a severity equal to or higher than this level will be sent. 0:Emergency only, 7:All (including Debug).
240+
// @Values: 0:Emergency, 1:Alert, 2:Critical, 3:Error, 4:Warning, 5:Notice, 6:Info, 7:Debug
241+
// @User: Standard
242+
AP_GROUPINFO("_MSG_NTC_LVL", 43, GCS, mav_msg_notice_level, 7),
237243

238244
AP_GROUPEND
239245
};
@@ -293,6 +299,9 @@ void GCS::send_textv(MAV_SEVERITY severity, const char *fmt, va_list arg_list)
293299

294300
void GCS::send_text(MAV_SEVERITY severity, const char *fmt, ...)
295301
{
302+
if (severity > mav_msg_notice_level) {
303+
return;
304+
}
296305
va_list arg_list;
297306
va_start(arg_list, fmt);
298307
send_textv(severity, fmt, arg_list);

libraries/GCS_MAVLink/GCS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,7 @@ class GCS
13241324
AP_Int16 mav_gcs_sysid_high;
13251325
AP_Enum16<Option> mav_options;
13261326
AP_Int8 mav_telem_delay;
1327+
AP_Int8 mav_msg_notice_level;
13271328

13281329
private:
13291330

0 commit comments

Comments
 (0)