Skip to content

Commit

Permalink
Add RSSI dBm alarm configurable in the OSD tab (#4020)
Browse files Browse the repository at this point in the history
  • Loading branch information
McGiverGim authored Jun 13, 2024
1 parent 08214ef commit cf2662c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6236,6 +6236,11 @@
"message": "Link Quality",
"description": "Text of the link quality alarm"
},
"osdTimerAlarmOptionRssiDbm": {
"message": "RSSI dBm",
"description": "Text of the RSSI dBm alarm"
},

"osdWarningTextArmingDisabled": {
"message": "Arming disabled",
"description": "One of the warnings that can be selected to be shown in the OSD"
Expand Down
2 changes: 1 addition & 1 deletion src/js/data_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const API_VERSION_1_47 = '1.47.0';
const CONFIGURATOR = {
// all versions are specified and compared using semantic versioning http://semver.org/
API_VERSION_ACCEPTED: API_VERSION_1_44,
API_VERSION_MAX_SUPPORTED: API_VERSION_1_46,
API_VERSION_MAX_SUPPORTED: API_VERSION_1_47,

connectionValid: false,
connectionValidCliOnly: false,
Expand Down
11 changes: 10 additions & 1 deletion src/js/tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import VirtualFC from "../VirtualFC";
import FC from "../fc";
import MSP from "../msp";
import MSPCodes from "../msp/MSPCodes";
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46 } from "../data_storage";
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from "../data_storage";
import LogoManager from "../LogoManager";
import { gui_log } from "../gui_log";
import semver from "semver";
Expand Down Expand Up @@ -2188,6 +2188,11 @@ OSD.msp = {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
result.push16(OSD.data.alarms.link_quality.value);
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
result.push16(OSD.data.alarms.rssi_dbm.value);
}

}
return result;
},
Expand Down Expand Up @@ -2402,6 +2407,10 @@ OSD.msp = {
d.alarms['link_quality'] = { display_name: i18n.getMessage('osdTimerAlarmOptionLinkQuality'), value: view.readU16() };
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
d.alarms['rssi_dbm'] = { display_name: i18n.getMessage('osdTimerAlarmOptionRssiDbm'), value: view.read16() };
}

this.processOsdElements(d, itemsPositionsRead);

OSD.updateDisplaySize();
Expand Down

0 comments on commit cf2662c

Please sign in to comment.