mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
Refactor radio settings and localization updates
fixes #72 - Removed preset configurations for 915 MHz, 868 MHz, and 433 MHz from the RadioSettings model. - Introduced a new list of regional preset configurations for various countries. - Updated the settings screen to use a dropdown for selecting presets instead of chips. - Added a switch for enabling client repeat functionality with appropriate warnings for frequency usage. - Updated localization files for multiple languages to reflect changes in settings related to client repeat functionality.
This commit is contained in:
parent
72f0aa7208
commit
947fafbbb7
35 changed files with 660 additions and 526 deletions
|
|
@ -59,46 +59,29 @@ class RadioSettings {
|
|||
required this.txPowerDbm,
|
||||
});
|
||||
|
||||
// Preset configurations
|
||||
static RadioSettings get preset915MHz => RadioSettings(
|
||||
frequencyMHz: 915.0,
|
||||
bandwidth: LoRaBandwidth.bw125,
|
||||
spreadingFactor: LoRaSpreadingFactor.sf7,
|
||||
codingRate: LoRaCodingRate.cr4_5,
|
||||
txPowerDbm: 20,
|
||||
);
|
||||
|
||||
static RadioSettings get preset868MHz => RadioSettings(
|
||||
frequencyMHz: 868.0,
|
||||
bandwidth: LoRaBandwidth.bw125,
|
||||
spreadingFactor: LoRaSpreadingFactor.sf7,
|
||||
codingRate: LoRaCodingRate.cr4_5,
|
||||
txPowerDbm: 14,
|
||||
);
|
||||
|
||||
static RadioSettings get preset433MHz => RadioSettings(
|
||||
frequencyMHz: 433.0,
|
||||
bandwidth: LoRaBandwidth.bw125,
|
||||
spreadingFactor: LoRaSpreadingFactor.sf7,
|
||||
codingRate: LoRaCodingRate.cr4_5,
|
||||
txPowerDbm: 20,
|
||||
);
|
||||
|
||||
static RadioSettings get presetLongRange => RadioSettings(
|
||||
frequencyMHz: 915.0,
|
||||
bandwidth: LoRaBandwidth.bw125,
|
||||
spreadingFactor: LoRaSpreadingFactor.sf12,
|
||||
codingRate: LoRaCodingRate.cr4_8,
|
||||
txPowerDbm: 20,
|
||||
);
|
||||
|
||||
static RadioSettings get presetFastSpeed => RadioSettings(
|
||||
frequencyMHz: 915.0,
|
||||
bandwidth: LoRaBandwidth.bw500,
|
||||
spreadingFactor: LoRaSpreadingFactor.sf7,
|
||||
codingRate: LoRaCodingRate.cr4_5,
|
||||
txPowerDbm: 20,
|
||||
);
|
||||
// Regional preset configurations
|
||||
static final List<(String, RadioSettings)> presets = [
|
||||
('Australia', RadioSettings(frequencyMHz: 915.8, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf10, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Australia (Narrow)', RadioSettings(frequencyMHz: 916.575, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf7, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Australia SA, WA, QLD', RadioSettings(frequencyMHz: 923.125, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf8, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Czech Republic', RadioSettings(frequencyMHz: 869.432, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf7, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('EU 433MHz', RadioSettings(frequencyMHz: 433.650, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('EU/UK (Long Range)', RadioSettings(frequencyMHz: 869.525, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('EU/UK (Medium Range)', RadioSettings(frequencyMHz: 869.525, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf10, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('EU/UK (Narrow)', RadioSettings(frequencyMHz: 869.618, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf8, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('New Zealand', RadioSettings(frequencyMHz: 917.375, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('New Zealand (Narrow)', RadioSettings(frequencyMHz: 917.375, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf7, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Portugal 433', RadioSettings(frequencyMHz: 433.375, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf9, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Portugal 869', RadioSettings(frequencyMHz: 869.618, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf7, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('Switzerland', RadioSettings(frequencyMHz: 869.618, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf8, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('USA Arizona', RadioSettings(frequencyMHz: 908.205, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf10, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('USA/Canada', RadioSettings(frequencyMHz: 910.525, bandwidth: LoRaBandwidth.bw62_5, spreadingFactor: LoRaSpreadingFactor.sf7, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Vietnam', RadioSettings(frequencyMHz: 920.250, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
// Off-grid repeat presets (valid client_repeat frequencies)
|
||||
('Off-Grid 433', RadioSettings(frequencyMHz: 433.0, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
('Off-Grid 869', RadioSettings(frequencyMHz: 869.0, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 14)),
|
||||
('Off-Grid 918', RadioSettings(frequencyMHz: 918.0, bandwidth: LoRaBandwidth.bw250, spreadingFactor: LoRaSpreadingFactor.sf11, codingRate: LoRaCodingRate.cr4_5, txPowerDbm: 20)),
|
||||
];
|
||||
|
||||
int get frequencyHz => (frequencyMHz * 1000).round();
|
||||
int get bandwidthHz => bandwidth.hz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue