From 8bc5f797da8d6432ba2fc74a0dc9989419378136 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sun, 15 Sep 2024 01:04:14 +0100 Subject: [PATCH] AP_Scripting: add binding for vehicle `register_custom_mode` --- libraries/AP_Scripting/docs/docs.lua | 7 +++++++ libraries/AP_Scripting/generator/description/bindings.desc | 1 + 2 files changed, 8 insertions(+) diff --git a/libraries/AP_Scripting/docs/docs.lua b/libraries/AP_Scripting/docs/docs.lua index 3a34534316..1197c502c8 100644 --- a/libraries/AP_Scripting/docs/docs.lua +++ b/libraries/AP_Scripting/docs/docs.lua @@ -2826,6 +2826,13 @@ function vehicle:is_landing() end ---@return boolean -- true on success function vehicle:set_crosstrack_start(new_start_location) end +-- Register a custom mode. This behaves like guided mode but will report with a custom number and name +---@param number integer -- mode number to use, should be over 100 +---@param full_name string -- Full mode name +---@param short_name string -- Short mode name upto 4 characters +---@return boolean -- true if successful +function vehicle:register_custom_mode(number, full_name, short_name) end + -- desc onvif = {} diff --git a/libraries/AP_Scripting/generator/description/bindings.desc b/libraries/AP_Scripting/generator/description/bindings.desc index ae6ba0a48f..234b2dbd78 100644 --- a/libraries/AP_Scripting/generator/description/bindings.desc +++ b/libraries/AP_Scripting/generator/description/bindings.desc @@ -352,6 +352,7 @@ singleton AP_Vehicle method reboot void boolean singleton AP_Vehicle method is_landing boolean singleton AP_Vehicle method is_taking_off boolean singleton AP_Vehicle method set_crosstrack_start boolean Location +singleton AP_Vehicle method register_custom_mode boolean uint8_t'skip_check string string include AP_SerialLED/AP_SerialLED.h