From ab8142de0fb9128ffef64fdafd8825fc4ce994a1 Mon Sep 17 00:00:00 2001 From: Michael Vierling Date: Mon, 19 Dec 2022 14:14:45 -0800 Subject: [PATCH 1/4] Define custom regions --- src/lib.rs | 26 ++++++++++++++++++++++++++ src/region.proto | 13 +++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 25055427..b511fbb3 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -148,12 +148,25 @@ impl std::str::FromStr for Region { match s.to_ascii_uppercase().as_str() { "US915" => Ok(Region::Us915), "EU868" => Ok(Region::Eu868), + "EU868_A" => Ok(Region::Eu868a), + "EU868_B" => Ok(Region::Eu868b), + "EU868_C" => Ok(Region::Eu868c), + "EU868_D" => Ok(Region::Eu868d), + "EU868_E" => Ok(Region::Eu868e), + "EU868_F" => Ok(Region::Eu868f), "EU433" => Ok(Region::Eu433), "CN470" => Ok(Region::Cn470), "CN779" => Ok(Region::Cn779), "AU915" => Ok(Region::Au915), + "AU915_SB1" => Ok(Region::Au915Sb1), + "AU915_SB2" => Ok(Region::Au915Sb2), "AS923_1" => Ok(Region::As9231), + "AS923_1A" => Ok(Region::As9231a), "AS923_1B" => Ok(Region::As9231b), + "AS923_1C" => Ok(Region::As9231c), + "AS923_1D" => Ok(Region::As9231d), + "AS923_1E" => Ok(Region::As9231e), + "AS923_1f" => Ok(Region::As9231f), "AS923_2" => Ok(Region::As9232), "AS923_3" => Ok(Region::As9233), "AS923_4" => Ok(Region::As9234), @@ -173,12 +186,25 @@ impl std::fmt::Display for Region { match self { Region::Us915 => f.write_str("US915"), Region::Eu868 => f.write_str("EU868"), + Region::Eu868a => f.write_str("EU868_A"), + Region::Eu868b => f.write_str("EU868_B"), + Region::Eu868c => f.write_str("EU868_C"), + Region::Eu868d => f.write_str("EU868_D"), + Region::Eu868e => f.write_str("EU868_E"), + Region::Eu868f => f.write_str("EU868_F"), Region::Eu433 => f.write_str("EU433"), Region::Cn470 => f.write_str("CN470"), Region::Cn779 => f.write_str("CN779"), Region::Au915 => f.write_str("AU915"), + Region::Au915sb1 => f.write_str("AU915_SB1"), + Region::Au915sb2 => f.write_str("AU915_SB2"), Region::As9231 => f.write_str("AS923_1"), + Region::As9231a => f.write_str("AS923_1A"), Region::As9231b => f.write_str("AS923_1B"), + Region::As9231c => f.write_str("AS923_1C"), + Region::As9231d => f.write_str("AS923_1D"), + Region::As9231e => f.write_str("AS923_1E"), + Region::As9231f => f.write_str("AS923_1F"), Region::As9232 => f.write_str("AS923_2"), Region::As9233 => f.write_str("AS923_3"), Region::As9234 => f.write_str("AS923_4"), diff --git a/src/region.proto b/src/region.proto index 8b729611..facb13ed 100644 --- a/src/region.proto +++ b/src/region.proto @@ -18,4 +18,17 @@ enum region { AS923_1B = 12; CD900_1A = 13; RU864 = 14; + EU868_A = 15; + EU868_B = 16; + EU868_C = 17; + EU868_D = 18; + EU868_E = 19; + EU868_F = 20; + AU915_SB1 = 21; + AU915_SB2 = 22; + AS923_1A = 23; + AS923_1C = 24; + AS923_1D = 25; + AS923_1E = 26; + AS923_1F = 27; } From 07f22aa0f11c37834157feb795ec0e3372266100 Mon Sep 17 00:00:00 2001 From: Michael Vierling Date: Thu, 22 Dec 2022 12:21:28 -0800 Subject: [PATCH 2/4] update case --- src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b511fbb3..ef21d38b 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -148,12 +148,12 @@ impl std::str::FromStr for Region { match s.to_ascii_uppercase().as_str() { "US915" => Ok(Region::Us915), "EU868" => Ok(Region::Eu868), - "EU868_A" => Ok(Region::Eu868a), - "EU868_B" => Ok(Region::Eu868b), - "EU868_C" => Ok(Region::Eu868c), - "EU868_D" => Ok(Region::Eu868d), - "EU868_E" => Ok(Region::Eu868e), - "EU868_F" => Ok(Region::Eu868f), + "EU868_A" => Ok(Region::Eu868A), + "EU868_B" => Ok(Region::Eu868B), + "EU868_C" => Ok(Region::Eu868C), + "EU868_D" => Ok(Region::Eu868D), + "EU868_E" => Ok(Region::Eu868E), + "EU868_F" => Ok(Region::Eu868F), "EU433" => Ok(Region::Eu433), "CN470" => Ok(Region::Cn470), "CN779" => Ok(Region::Cn779), @@ -186,12 +186,12 @@ impl std::fmt::Display for Region { match self { Region::Us915 => f.write_str("US915"), Region::Eu868 => f.write_str("EU868"), - Region::Eu868a => f.write_str("EU868_A"), - Region::Eu868b => f.write_str("EU868_B"), - Region::Eu868c => f.write_str("EU868_C"), - Region::Eu868d => f.write_str("EU868_D"), - Region::Eu868e => f.write_str("EU868_E"), - Region::Eu868f => f.write_str("EU868_F"), + Region::Eu868A => f.write_str("EU868_A"), + Region::Eu868B => f.write_str("EU868_B"), + Region::Eu868C => f.write_str("EU868_C"), + Region::Eu868D => f.write_str("EU868_D"), + Region::Eu868E => f.write_str("EU868_E"), + Region::Eu868F => f.write_str("EU868_F"), Region::Eu433 => f.write_str("EU433"), Region::Cn470 => f.write_str("CN470"), Region::Cn779 => f.write_str("CN779"), From dd7c725f84a1b2da7e8a4f1fe273d4fc5432584e Mon Sep 17 00:00:00 2001 From: Michael Vierling Date: Thu, 22 Dec 2022 12:35:55 -0800 Subject: [PATCH 3/4] update case --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ef21d38b..07da1fb7 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -196,8 +196,8 @@ impl std::fmt::Display for Region { Region::Cn470 => f.write_str("CN470"), Region::Cn779 => f.write_str("CN779"), Region::Au915 => f.write_str("AU915"), - Region::Au915sb1 => f.write_str("AU915_SB1"), - Region::Au915sb2 => f.write_str("AU915_SB2"), + Region::Au915Sb1 => f.write_str("AU915_SB1"), + Region::Au915Sb2 => f.write_str("AU915_SB2"), Region::As9231 => f.write_str("AS923_1"), Region::As9231a => f.write_str("AS923_1A"), Region::As9231b => f.write_str("AS923_1B"), From e964419ddf44c1fb3abfe2d37443e279d250d262 Mon Sep 17 00:00:00 2001 From: Michael Vierling Date: Thu, 22 Dec 2022 12:39:06 -0800 Subject: [PATCH 4/4] update case --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 07da1fb7..f9f241c2 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,7 +166,7 @@ impl std::str::FromStr for Region { "AS923_1C" => Ok(Region::As9231c), "AS923_1D" => Ok(Region::As9231d), "AS923_1E" => Ok(Region::As9231e), - "AS923_1f" => Ok(Region::As9231f), + "AS923_1F" => Ok(Region::As9231f), "AS923_2" => Ok(Region::As9232), "AS923_3" => Ok(Region::As9233), "AS923_4" => Ok(Region::As9234),