feat: add RegionCode descriptions to region selection

closes #987
This commit is contained in:
andrekir 2024-10-09 16:43:05 -03:00
parent 23f05c109b
commit 9cce785556
3 changed files with 50 additions and 36 deletions

View file

@ -64,29 +64,29 @@ internal fun LoRaConfig.radioFreq(channelNum: Int): Float {
@Suppress("MagicNumber")
enum class RegionInfo(
val regionCode: RegionCode,
val description: String,
val freqStart: Float,
val freqEnd: Float,
) {
US(RegionCode.US, 902.0f, 928.0f),
EU_433(RegionCode.EU_433, 433.0f, 434.0f),
EU_868(RegionCode.EU_868, 869.4f, 869.65f),
CN(RegionCode.CN, 470.0f, 510.0f),
JP(RegionCode.JP, 920.5f, 923.5f),
ANZ(RegionCode.ANZ, 915.0f, 928.0f),
RU(RegionCode.RU, 868.7f, 869.2f),
KR(RegionCode.KR, 920.0f, 923.0f),
TW(RegionCode.TW, 920.0f, 925.0f),
IN(RegionCode.IN, 865.0f, 867.0f),
NZ_865(RegionCode.NZ_865, 864.0f, 868.0f),
TH(RegionCode.TH, 920.0f, 925.0f),
UA_433(RegionCode.UA_433, 433.0f, 434.7f),
UA_868(RegionCode.UA_868, 868.0f, 868.6f),
MY_433(RegionCode.MY_433, 433.0f, 435.0f),
MY_919(RegionCode.MY_919, 919.0f, 924.0f),
SG_923(RegionCode.SG_923, 917.0f, 925.0f),
LORA_24(RegionCode.LORA_24, 2400.0f, 2483.5f),
UNSET(RegionCode.UNSET, 902.0f, 928.0f),
;
UNSET(RegionCode.UNSET, "Please set a region", 902.0f, 928.0f),
US(RegionCode.US, "United States", 902.0f, 928.0f),
EU_433(RegionCode.EU_433, "European Union 433MHz", 433.0f, 434.0f),
EU_868(RegionCode.EU_868, "European Union 868MHz", 869.4f, 869.65f),
CN(RegionCode.CN, "China", 470.0f, 510.0f),
JP(RegionCode.JP, "Japan", 920.5f, 923.5f),
ANZ(RegionCode.ANZ, "Australia / New Zealand", 915.0f, 928.0f),
KR(RegionCode.KR, "Korea", 920.0f, 923.0f),
TW(RegionCode.TW, "Taiwan", 920.0f, 925.0f),
RU(RegionCode.RU, "Russia", 868.7f, 869.2f),
IN(RegionCode.IN, "India", 865.0f, 867.0f),
NZ_865(RegionCode.NZ_865, "New Zealand 865MHz", 864.0f, 868.0f),
TH(RegionCode.TH, "Thailand", 920.0f, 925.0f),
UA_433(RegionCode.UA_433, "Ukraine 433MHz", 433.0f, 434.7f),
UA_868(RegionCode.UA_868, "Ukraine 868MHz", 868.0f, 868.6f),
MY_433(RegionCode.MY_433, "Malaysia 433MHz", 433.0f, 435.0f),
MY_919(RegionCode.MY_919, "Malaysia 919MHz", 919.0f, 924.0f),
SG_923(RegionCode.SG_923, "Singapore 923MHz", 917.0f, 925.0f),
LORA_24(RegionCode.LORA_24, "2.4 GHz", 2400.0f, 2483.5f),
}
enum class ChannelOption(