diff --git a/libraries/AP_MSP/AP_MSP_Telem_Backend.cpp b/libraries/AP_MSP/AP_MSP_Telem_Backend.cpp index edc3712b96..9e8f744fdf 100644 --- a/libraries/AP_MSP/AP_MSP_Telem_Backend.cpp +++ b/libraries/AP_MSP/AP_MSP_Telem_Backend.cpp @@ -468,12 +468,12 @@ MSPCommandResult AP_MSP_Telem_Backend::msp_process_sensor_command(uint16_t cmd_m switch (cmd_msp) { case MSP2_SENSOR_RANGEFINDER: { - const MSP::msp_rangefinder_sensor_t *pkt = (const MSP::msp_rangefinder_sensor_t *)src->ptr; + const MSP::msp_rangefinder_data_message_t *pkt = (const MSP::msp_rangefinder_data_message_t *)src->ptr; msp_handle_rangefinder(*pkt); } break; case MSP2_SENSOR_OPTIC_FLOW: { - const MSP::msp_opflow_sensor_t *pkt = (const MSP::msp_opflow_sensor_t *)src->ptr; + const MSP::msp_opflow_data_message_t *pkt = (const MSP::msp_opflow_data_message_t *)src->ptr; msp_handle_opflow(*pkt); } break; @@ -497,7 +497,7 @@ MSPCommandResult AP_MSP_Telem_Backend::msp_process_sensor_command(uint16_t cmd_m return MSP_RESULT_NO_REPLY; } -void AP_MSP_Telem_Backend::msp_handle_opflow(const MSP::msp_opflow_sensor_t &pkt) +void AP_MSP_Telem_Backend::msp_handle_opflow(const MSP::msp_opflow_data_message_t &pkt) { #if HAL_MSP_OPTICALFLOW_ENABLED OpticalFlow *optflow = AP::opticalflow(); @@ -508,7 +508,7 @@ void AP_MSP_Telem_Backend::msp_handle_opflow(const MSP::msp_opflow_sensor_t &pkt #endif } -void AP_MSP_Telem_Backend::msp_handle_rangefinder(const MSP::msp_rangefinder_sensor_t &pkt) +void AP_MSP_Telem_Backend::msp_handle_rangefinder(const MSP::msp_rangefinder_data_message_t &pkt) { #if HAL_MSP_RANGEFINDER_ENABLED RangeFinder *rangefinder = AP::rangefinder(); diff --git a/libraries/AP_MSP/AP_MSP_Telem_Backend.h b/libraries/AP_MSP/AP_MSP_Telem_Backend.h index b34db4e792..771eef76ee 100644 --- a/libraries/AP_MSP/AP_MSP_Telem_Backend.h +++ b/libraries/AP_MSP/AP_MSP_Telem_Backend.h @@ -159,8 +159,8 @@ protected: MSP::MSPCommandResult msp_process_out_command(uint16_t cmd_msp, MSP::sbuf_t *dst); // MSP sensor command processing - void msp_handle_opflow(const MSP::msp_opflow_sensor_t &pkt); - void msp_handle_rangefinder(const MSP::msp_rangefinder_sensor_t &pkt); + void msp_handle_opflow(const MSP::msp_opflow_data_message_t &pkt); + void msp_handle_rangefinder(const MSP::msp_rangefinder_data_message_t &pkt); void msp_handle_gps(const MSP::msp_gps_data_message_t &pkt); void msp_handle_compass(const MSP::msp_compass_data_message_t &pkt); void msp_handle_baro(const MSP::msp_baro_data_message_t &pkt); diff --git a/libraries/AP_MSP/msp_sensors.h b/libraries/AP_MSP/msp_sensors.h index ecf9418335..e8d7f07b73 100644 --- a/libraries/AP_MSP/msp_sensors.h +++ b/libraries/AP_MSP/msp_sensors.h @@ -2,20 +2,18 @@ namespace MSP { -// inav/src/main/io/rangefinder_msp.c +// src/main/msp/msp_protocol_v2_sensor_msg.h typedef struct PACKED { uint8_t quality; // [0;255] int32_t distance_mm; // Negative value for out of range -} msp_rangefinder_sensor_t; +} msp_rangefinder_data_message_t; -// inav/src/main/io/opflow_msp.c typedef struct PACKED { uint8_t quality; // [0;255] int32_t motion_x; int32_t motion_y; -} msp_opflow_sensor_t; +} msp_opflow_data_message_t; -// inav/src/main/io/gps_msp.c typedef struct PACKED { uint8_t instance; // sensor instance number to support multi-sensor setups uint16_t gps_week; // GPS week, 0xFFFF if not available