Commit Graph
18 Commits
Author SHA1 Message Date
Peter BarkerandClaude Opus 4.8 9a7c74e3fb AP_VideoTX: clamp SmartAudio power level count from the wire
unpack_settings() for the v2.1 extended response frame copied
num_power_levels+1 bytes into the fixed power_levels[8] array, where
num_power_levels comes straight from the wire and is unbounded.  A
malformed frame could request a copy of up to 256 bytes, overrunning
both the source and destination arrays.

Clamp the count to the size of the arrays before copying.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:33:22 +10:00
Peter BarkerandClaude Opus 4.8 701f11f8b6 AP_VideoTX: validate SmartAudio response length before parsing
parse_response_buffer() cast the received buffer to the response frame
struct selected by the command byte without checking that enough bytes
were actually received.  A short or corrupt frame (for example a
GET_SETTINGS response with a length field of zero) could pass the CRC
check yet cause the parser to read channel/power/frequency fields from
buffer positions that were never written this cycle, pushing stale
values into the VTX settings.

Pass the received byte count into parse_response_buffer() and, in each
command case, reject frames that are too short for the struct being
interpreted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:33:22 +10:00
Andy Piper 607249d73d AP_VideoTX: add autobauding to Tramp
Record enabled backends
2024-05-29 17:49:08 +10:00
Andy Piper 29d5d5a300 AP_VideoTX: learn all the power levels when using SmartAudio 2.0 2023-01-31 11:23:59 +11:00
Peter Barker 08e42d2699 AP_VideoTX: use minimize.inc for Tramp and SmartAudio
... and rename HAL_SMARTAUDIO_ENABLED
2023-01-24 11:03:27 +11:00
Peter Barker 96900ea627 AP_VideoTX: tidy AP_SerialManager.h includes 2022-11-08 09:49:19 +11:00
Andy Piper 0658f06030 AP_VideoTX: add lookup tables for VTX power settings
correct settings when power set is received
add support for capturing all supported power levels
learn power levels in SmartAudio 2.1
add better support for VTX power levels
don't set power to 0 if in pitmode
add option for iNav compatibility
support non-conforming SmartAudio implementations
re-enable pitmode on SmartAudio 2.0
add support for "blind" VTX setting
2022-09-22 10:48:04 +10:00
VMsunghwan a49bab158f AP_VideoTX : fixed typo
line 610 : to to -> to
2022-01-13 09:45:39 +11:00
Mingchen Zhang 61e0c5b6e7 AP_SmartAudio: fix a bug that would starve the lower priority thread, such as scripting. 2021-12-21 16:03:44 +09:00
giacomo892 9056cd35ea AP_SmartAudio: Add pull down VTX option 2021-06-16 18:49:13 +10:00
giacomo892 f12fffbb08 AP_SmartAudio: Remove useless variable and comment 2021-06-16 18:49:13 +10:00
giacomo892 4dac9baa09 AP_SmartAudio: Add configuration_finished and configuration_pending functions 2021-06-16 18:49:13 +10:00
Andy Piper db06de5c9c AP_VideoTX: correctly deal with unresolvable options requests
move power changes to middle of RC range
2021-05-12 18:03:28 +10:00
Andy Piper 21e95a62d5 AP_VideoTX: increase stack for smart audio thread 2021-04-20 10:39:16 +10:00
Andy Piper 4fd88e8ad0 AP_VideoTX: don't try to change pitmode on anything other than SA2.1 2021-04-12 16:22:36 +10:00
Andy Piper bfcefa3f34 AP_VideoTX: prioritize pitmode changes over power changes 2021-04-12 16:22:36 +10:00
Andy Piper f7e23566ac AP_VideoTX: with SmartAudio v2 set the power level rather than power in dBm 2021-03-17 18:27:11 +11:00
Andy Piperandluis.martinez.exts 6f91e053d5 AP_VideoTX: new library to support the SmartAudio protocol
set the VTX parameters to what was actually configured by the VTX
use change band/change frequency when appropriate
set power levels appropriately for protocol version.

Co-authored-by: luis.martinez.exts <luis.martinez@juntadeandalucia.es>
2021-02-17 18:23:33 +11:00