mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Add RSSI dBm alarm to MSP (#13682)
* Upgrade MSP version to 1.47 * Add RSSI dBm alarm to MSP * Fix unit test after changing MSP version
This commit is contained in:
parent
d82c8facb2
commit
dc40b8f655
3 changed files with 10 additions and 2 deletions
|
@ -1050,6 +1050,9 @@ static bool mspCommonProcessOutCommand(int16_t cmdMSP, sbuf_t *dst, mspPostProce
|
|||
// API >= 1.46
|
||||
sbufWriteU16(dst, osdConfig()->link_quality_alarm);
|
||||
|
||||
// API >= 1.47
|
||||
sbufWriteU16(dst, osdConfig()->rssi_dbm_alarm);
|
||||
|
||||
break;
|
||||
}
|
||||
#endif // USE_OSD
|
||||
|
@ -4262,6 +4265,11 @@ static mspResult_e mspCommonProcessInCommand(mspDescriptor_t srcDesc, int16_t cm
|
|||
osdConfigMutable()->link_quality_alarm = sbufReadU16(src);
|
||||
}
|
||||
|
||||
if (sbufBytesRemaining(src) >= 2) {
|
||||
// API >= 1.47
|
||||
osdConfigMutable()->rssi_dbm_alarm = sbufReadU16(src);
|
||||
}
|
||||
|
||||
} else if ((int8_t)addr == -2) {
|
||||
// Timers
|
||||
uint8_t index = sbufReadU8(src);
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#define MSP_PROTOCOL_VERSION 0
|
||||
|
||||
#define API_VERSION_MAJOR 1 // increment when major changes are made
|
||||
#define API_VERSION_MINOR 46 // increment after a release, to set the version for all changes to go into the following release (if no changes to MSP are made between the releases, this can be reverted before the release)
|
||||
#define API_VERSION_MINOR 47 // increment after a release, to set the version for all changes to go into the following release (if no changes to MSP are made between the releases, this can be reverted before the release)
|
||||
|
||||
#define API_VERSION_LENGTH 2
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ TEST(RxSpiExpressLrsTelemetryUnitTest, TestFlightMode)
|
|||
TEST(RxSpiExpressLrsTelemetryUnitTest, TestMspVersionRequest)
|
||||
{
|
||||
uint8_t request[15] = {238, 12, 122, 200, 234, 48, 0, 1, 1, 0, 0, 0, 0, 128, 0};
|
||||
uint8_t response[12] = {200, 10, 123, 234, 200, 48, 3, 1, 0, API_VERSION_MAJOR, API_VERSION_MINOR, 0x55};
|
||||
uint8_t response[12] = {200, 10, 123, 234, 200, 48, 3, 1, 0, API_VERSION_MAJOR, API_VERSION_MINOR, 0x80};
|
||||
uint8_t data1[6] = {1, request[0], request[1], request[2], request[3], request[4]};
|
||||
uint8_t data2[6] = {2, request[5], request[6], request[7], request[8], request[9]};
|
||||
uint8_t data3[6] = {3, request[10], request[11], request[12], request[13], request[14]};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue