AP_Mount: fix for Siyi A8

This commit is contained in:
Randy Mackay 2022-11-29 11:42:51 +09:00 committed by Andrew Tridgell
parent 34bb5e10cd
commit 345629cdad
1 changed files with 10 additions and 5 deletions

View File

@ -294,7 +294,8 @@ void AP_Mount_Siyi::process_packet()
switch ((SiyiCommandId)_parsed_msg.command_id) {
case SiyiCommandId::ACQUIRE_FIRMWARE_VERSION: {
if (_parsed_msg.data_bytes_received != 12) {
if (_parsed_msg.data_bytes_received != 12 && // ZR10 firmware version reply is 12bytes
_parsed_msg.data_bytes_received != 8) { // A8 firmware version reply is 8 bytes
#if AP_MOUNT_SIYI_DEBUG
unexpected_len = true;
#endif
@ -315,10 +316,14 @@ void AP_Mount_Siyi::process_packet()
(unsigned)_msg_buff[_msg_buff_data_start+7]); // firmware revision
// display zoom firmware version
debug("Mount: SiyiZoom fw:%u.%u.%u",
(unsigned)_msg_buff[_msg_buff_data_start+9], // firmware major version
(unsigned)_msg_buff[_msg_buff_data_start+10], // firmware minor version
(unsigned)_msg_buff[_msg_buff_data_start+11]); // firmware revision
#if AP_MOUNT_SIYI_DEBUG
if (_parsed_msg.data_bytes_received >= 12) {
debug("Mount: SiyiZoom fw:%u.%u.%u",
(unsigned)_msg_buff[_msg_buff_data_start+9], // firmware major version
(unsigned)_msg_buff[_msg_buff_data_start+10], // firmware minor version
(unsigned)_msg_buff[_msg_buff_data_start+11]); // firmware revision
}
#endif
break;
}