|
|
|
|
@ -59,46 +59,200 @@ 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;
|
|
|
|
|
|