From 1f9539a1b3416492c24e3ef73d4570ed5c3f9f4c Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sun, 2 Jul 2023 19:08:08 +0100 Subject: [PATCH] AP_BLHeli: add battery status MSP handling give internal error if an unknown MSP command occurs --- libraries/AP_BLHeli/AP_BLHeli.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/AP_BLHeli/AP_BLHeli.cpp b/libraries/AP_BLHeli/AP_BLHeli.cpp index 1c6670c4b2..1563a2fd95 100644 --- a/libraries/AP_BLHeli/AP_BLHeli.cpp +++ b/libraries/AP_BLHeli/AP_BLHeli.cpp @@ -450,6 +450,18 @@ void AP_BLHeli::msp_process_command(void) break; } + case MSP_BATTERY_STATE: { + debug("MSP_BATTERY_STATE"); + uint8_t buf[8]; + buf[0] = 4; // cell count + putU16(&buf[1], 1500); // mAh + buf[3] = 16; // V + putU16(&buf[4], 1500); // mAh + putU16(&buf[6], 1); // A + msp_send_reply(msp.cmdMSP, buf, sizeof(buf)); + break; + } + case MSP_MOTOR_CONFIG: { debug("MSP_MOTOR_CONFIG"); uint8_t buf[10];