From b7813df3a155e4c2b11da305fa615004fba4481c Mon Sep 17 00:00:00 2001 From: Geoff Sim Date: Mon, 16 Dec 2024 17:47:45 +0000 Subject: [PATCH 1/2] Drop MSP_VTX_CONFIG messages with an invalid VTX id --- src/msp_displayport.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msp_displayport.c b/src/msp_displayport.c index a343ffa..e535ed8 100644 --- a/src/msp_displayport.c +++ b/src/msp_displayport.c @@ -1055,6 +1055,11 @@ void parse_vtx_params(uint8_t isMSP_V2) { return; } + // Check for unknown VTX device (probably from a device that is not interested in controlling the VTX directly) + if (msp_rx_buf[0] = 0xff) { + return; + } + fc_pwr_rx = msp_rx_buf[3]; if (fc_pwr_rx == 0) { fc_pwr_rx = POWER_MAX+2; // 0mW From 275dbad53858c71c567c3fd077c7fa20dfbbc228 Mon Sep 17 00:00:00 2001 From: Geoff Sim Date: Tue, 17 Dec 2024 12:06:32 +0000 Subject: [PATCH 2/2] Fix comparison/assignment error. Ignore unknown and unsupported VTXs --- src/msp_displayport.c | 4 ++-- src/msp_displayport.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/msp_displayport.c b/src/msp_displayport.c index e535ed8..59828a3 100644 --- a/src/msp_displayport.c +++ b/src/msp_displayport.c @@ -1055,8 +1055,8 @@ void parse_vtx_params(uint8_t isMSP_V2) { return; } - // Check for unknown VTX device (probably from a device that is not interested in controlling the VTX directly) - if (msp_rx_buf[0] = 0xff) { + // Ignore unknown/unsupported VTX devices + if (msp_rx_buf[0] == VTXDEV_UNKNOWN || msp_rx_buf[0] == VTXDEV_UNSUPPORTED) { return; } diff --git a/src/msp_displayport.h b/src/msp_displayport.h index b9516e4..2d49603 100644 --- a/src/msp_displayport.h +++ b/src/msp_displayport.h @@ -112,6 +112,16 @@ typedef enum { VTX_MENU_SAVE_EXIT, } vtx_menu_state_e; +typedef enum { + VTXDEV_UNSUPPORTED = 0, // reserved for MSP + VTXDEV_RTC6705 = 1, + // 2 reserved + VTXDEV_SMARTAUDIO = 3, + VTXDEV_TRAMP = 4, + VTXDEV_MSP = 5, + VTXDEV_UNKNOWN = 0xFF, +} vtxDevType_e; + typedef enum { DISPLAY_OSD, DISPLAY_CMS,