AP_Scripting: add test for NAMED_VALUE_STRING

This commit is contained in:
Peter Barker
2025-08-10 08:38:08 +10:00
committed by Peter Barker
parent 975f373396
commit 4e7e417dc3
3 changed files with 16 additions and 0 deletions
+5
View File
@@ -2907,6 +2907,11 @@ gcs = {}
---@param value number -- value to send
function gcs:send_named_float(name, value) end
-- send named string value using NAMED_VALUE_STRING message
---@param name string -- up to 10 chars long
---@param value string -- value to send, up to 64 chars long
function gcs:send_named_string(name, value) end
-- set message interval for a given serial port and message id
---@param port_num integer -- serial port number
---@param msg_id uint32_t_ud|integer|number -- MAVLink message id
@@ -0,0 +1,10 @@
-- This script just sends a named value string in a loop...
function update() -- this is the loop which periodically runs
gcs:send_named_string('Lua String', "Lua String Value") -- send a value
-- this one is 70 characters long (longer than the field length of Value):
gcs:send_named_string('Long Lua String', "0123456789012345678901234567890123456789012345678901234567890123456789") -- send a value
return update, 1000 -- reschedules the loop
end
return update() -- run immediately before starting to reschedule
@@ -313,6 +313,7 @@ singleton GCS rename gcs
singleton GCS method send_text void MAV_SEVERITY'enum MAV_SEVERITY_EMERGENCY MAV_SEVERITY_DEBUG "%s"'literal string
singleton GCS method set_message_interval MAV_RESULT'enum uint8_t 0 MAVLINK_COMM_NUM_BUFFERS uint32_t'skip_check int32_t -1 INT32_MAX
singleton GCS method send_named_float void string float'skip_check
singleton GCS method send_named_string void string string
singleton GCS method frame_type MAV_TYPE'enum
singleton GCS method get_hud_throttle int16_t
singleton GCS method sysid_mygcs_last_seen_time_ms uint32_t