mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
fix the invalid payload size for link stats TX frame
This commit is contained in:
parent
eb16326897
commit
8872830410
2 changed files with 14 additions and 13 deletions
|
@ -387,13 +387,13 @@ STATIC_UNIT_TESTED void crsfDataReceive(uint16_t c, void *data)
|
||||||
#if defined(USE_CRSF_LINK_STATISTICS)
|
#if defined(USE_CRSF_LINK_STATISTICS)
|
||||||
|
|
||||||
case CRSF_FRAMETYPE_LINK_STATISTICS: {
|
case CRSF_FRAMETYPE_LINK_STATISTICS: {
|
||||||
// if to FC and 10 bytes + CRSF_FRAME_ORIGIN_DEST_SIZE
|
// if to FC and 10 bytes + CRSF_FRAME_ORIGIN_DEST_SIZE
|
||||||
if ((rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) &&
|
if ((rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) &&
|
||||||
(crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) &&
|
(crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) &&
|
||||||
(crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE)) {
|
(crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE)) {
|
||||||
const crsfLinkStatistics_t* statsFrame = (const crsfLinkStatistics_t*)&crsfFrame.frame.payload;
|
const crsfLinkStatistics_t* statsFrame = (const crsfLinkStatistics_t*)&crsfFrame.frame.payload;
|
||||||
handleCrsfLinkStatisticsFrame(statsFrame, currentTimeUs);
|
handleCrsfLinkStatisticsFrame(statsFrame, currentTimeUs);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if defined(USE_CRSF_V3)
|
#if defined(USE_CRSF_V3)
|
||||||
|
@ -401,12 +401,12 @@ STATIC_UNIT_TESTED void crsfDataReceive(uint16_t c, void *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CRSF_FRAMETYPE_LINK_STATISTICS_TX: {
|
case CRSF_FRAMETYPE_LINK_STATISTICS_TX: {
|
||||||
if ((rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) &&
|
if ((rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) &&
|
||||||
(crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) &&
|
(crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) &&
|
||||||
(crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE)) {
|
(crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_TX_PAYLOAD_SIZE)) {
|
||||||
const crsfLinkStatisticsTx_t* statsFrame = (const crsfLinkStatisticsTx_t*)&crsfFrame.frame.payload;
|
const crsfLinkStatisticsTx_t* statsFrame = (const crsfLinkStatisticsTx_t*)&crsfFrame.frame.payload;
|
||||||
handleCrsfLinkStatisticsTxFrame(statsFrame, currentTimeUs);
|
handleCrsfLinkStatisticsTxFrame(statsFrame, currentTimeUs);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -84,6 +84,7 @@ enum {
|
||||||
CRSF_FRAME_GPS_PAYLOAD_SIZE = 15,
|
CRSF_FRAME_GPS_PAYLOAD_SIZE = 15,
|
||||||
CRSF_FRAME_BATTERY_SENSOR_PAYLOAD_SIZE = 8,
|
CRSF_FRAME_BATTERY_SENSOR_PAYLOAD_SIZE = 8,
|
||||||
CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE = 10,
|
CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE = 10,
|
||||||
|
CRSF_FRAME_LINK_STATISTICS_TX_PAYLOAD_SIZE = 6,
|
||||||
CRSF_FRAME_RC_CHANNELS_PAYLOAD_SIZE = 22, // 11 bits per channel * 16 channels = 22 bytes.
|
CRSF_FRAME_RC_CHANNELS_PAYLOAD_SIZE = 22, // 11 bits per channel * 16 channels = 22 bytes.
|
||||||
CRSF_FRAME_ATTITUDE_PAYLOAD_SIZE = 6,
|
CRSF_FRAME_ATTITUDE_PAYLOAD_SIZE = 6,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue