diff --git a/src/components/pages/SettingsPage.vue b/src/components/pages/SettingsPage.vue index 3a06a7d..4fec707 100644 --- a/src/components/pages/SettingsPage.vue +++ b/src/components/pages/SettingsPage.vue @@ -57,8 +57,8 @@
Radio Settings
-
Frequency (kHz)
- +
Frequency (MHz)
+
@@ -124,7 +124,11 @@ export default { await Connection.loadSelfInfo(); this.name = GlobalState.selfInfo.name; - this.radioFreq = GlobalState.selfInfo.radioFreq; + + // convert radio frequency from kHz to MHz + // e.g: 917375 -> 917.375 + this.radioFreq = GlobalState.selfInfo.radioFreq / 1000; + this.radioBw = GlobalState.selfInfo.radioBw; this.radioSf = GlobalState.selfInfo.radioSf; this.radioCr = GlobalState.selfInfo.radioCr; @@ -189,6 +193,10 @@ export default { this.longitude = 0; } + // convert radio frequency from MHz to kHz + // e.g: 917.375 -> 917375 + const radioFreq = this.radioFreq * 1000; + // convert latitude and longitude from decimal to integer // e.g: -38.664646, 178.023507 -> -38664646, 178023507 const latitude = Math.floor(this.latitude * 1000000); @@ -197,7 +205,7 @@ export default { // save settings await Connection.setAdvertName(this.name); await Connection.setAdvertLatLong(latitude, longitude); - await Connection.setRadioParams(this.radioFreq, this.radioBw, this.radioSf, this.radioCr); + await Connection.setRadioParams(radioFreq, this.radioBw, this.radioSf, this.radioCr); await Connection.setTxPower(this.txPower); // reload self info