Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

define custom regions #27

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/helium_config/core/gwmp_opts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ defmodule HeliumConfig.Core.GwmpOpts do
def region_from_web("AS923_2"), do: :AS923_2
def region_from_web("AS923_3"), do: :AS923_3
def region_from_web("AS923_4"), do: :AS923_4
def region_from_web("AS923_1A"), do: :AS923_1A
def region_from_web("AS923_1B"), do: :AS923_1B
def region_from_web("AS923_1C"), do: :AS923_1C
def region_from_web("AS923_1D"), do: :AS923_1D
def region_from_web("AS923_1E"), do: :AS923_1E
def region_from_web("AS923_1F"), do: :AS923_1F
def region_from_web("AU915_SB1"), do: :AU915_SB1
def region_from_web("AU915_SB2"), do: :AU915_SB2
def region_from_web("EU868_A"), do: :EU868_A
def region_from_web("EU868_B"), do: :EU868_B
def region_from_web("EU868_C"), do: :EU868_C
def region_from_web("EU868_D"), do: :EU868_D
def region_from_web("EU868_E"), do: :EU868_E
def region_from_web("EU868_F"), do: :EU868_F
def region_from_web("CD900_1A"), do: :CD900_1A
end
13 changes: 13 additions & 0 deletions lib/helium_config_web/views/route_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ defmodule HeliumConfigWeb.RouteView do
def region_json(:AS923_2), do: "AS923_2"
def region_json(:AS923_3), do: "AS923_3"
def region_json(:AS923_4), do: "AS923_4"
def region_json(:AS923_1A), do: "AS923_1A"
def region_json(:AS923_1B), do: "AS923_1B"
def region_json(:AS923_1C), do: "AS923_1C"
def region_json(:AS923_1D), do: "AS923_1D"
def region_json(:AS923_1E), do: "AS923_1E"
def region_json(:AS923_1F), do: "AS923_1F"
def region_json(:AU915_SB1), do: "AU915_SB1"
def region_json(:AU915_SB2), do: "AU915_SB2"
def region_json(:EU868_A), do: "EU868_A"
def region_json(:EU868_B), do: "EU868_B"
def region_json(:EU868_C), do: "EU868_C"
def region_json(:EU868_D), do: "EU868_D"
def region_json(:EU868_E), do: "EU868_E"
def region_json(:EU868_F), do: "EU868_F"
def region_json(:CD900_1A), do: "CD900_1A"
end
54 changes: 53 additions & 1 deletion scripts/create_org.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,62 @@ curl -v \
},
{
"port": 10012,
"region": "AS923_1B"
"region": "AS923_1A"
},
{
"port": 10013,
"region": "AS923_1B"
},
{
"port": 10014,
"region": "AS923_1C"
},
{
"port": 10015,
"region": "AS923_1D"
},
{
"port": 10016,
"region": "AS923_1E"
},
{
"port": 10017,
"region": "AS923_1F"
},
{
"port": 10018,
"region": "AU915_SB1"
},
{
"port": 10019,
"region": "AU915_SB2"
},
{
"port": 10020,
"region": "EU868_A"
},
{
"port": 10021,
"region": "EU868_B"
},
{
"port": 10022,
"region": "EU868_C"
},
{
"port": 10023,
"region": "EU868_D"
},
{
"port": 10024,
"region": "EU868_E"
},
{
"port": 10025,
"region": "EU868_F"
},
{
"port": 10026,
"region": "CD900_1A"
}
],
Expand Down
54 changes: 53 additions & 1 deletion scripts/update_org.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,62 @@ curl -v \
},
{
"port": 10012,
"region": "AS923_1B"
"region": "AS923_1A"
},
{
"port": 10013,
"region": "AS923_1B"
},
{
"port": 10014,
"region": "AS923_1C"
},
{
"port": 10015,
"region": "AS923_1D"
},
{
"port": 10016,
"region": "AS923_1E"
},
{
"port": 10017,
"region": "AS923_1F"
},
{
"port": 10018,
"region": "AU915_SB1"
},
{
"port": 10019,
"region": "AU915_SB2"
},
{
"port": 10020,
"region": "EU868_A"
},
{
"port": 10021,
"region": "EU868_B"
},
{
"port": 10022,
"region": "EU868_C"
},
{
"port": 10023,
"region": "EU868_D"
},
{
"port": 10024,
"region": "EU868_E"
},
{
"port": 10025,
"region": "EU868_F"
},
{
"port": 10026,
"region": "CD900_1A"
}
],
Expand Down
17 changes: 15 additions & 2 deletions test/helium_config_grpc/route_view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,21 @@ defmodule HeliumConfigGRPC.RouteViewTest do
%{region: :AS923_2, port: 1009},
%{region: :AS923_3, port: 10010},
%{region: :AS923_4, port: 10011},
%{region: :AS923_1B, port: 10012},
%{region: :CD900_1A, port: 10013}
%{region: :AS923_1A, port: 10012},
%{region: :AS923_1B, port: 10013},
%{region: :AS923_1C, port: 10014},
%{region: "AS923_1D, port: 10015},
%{region: :AS923_1E, port: 10016},
%{region: :AS923_1F, port: 10017},
%{region: :AU915_SB1, port: 10018},
%{region: :AU915_SB2, port: 10019},
%{region: :EU868_A, port: 10020},
%{region: :EU868_B, port: 10021},
%{region: :EU868_C, port: 10022},
%{region: :EU868_D, port: 10023},
%{region: :EU868_E, port: 10024},
%{region: :EU868_F, port: 10025},
%{region: :CD900_1A, port: 10026}
]
}}
},
Expand Down
17 changes: 15 additions & 2 deletions test/helium_config_web/views/organization_view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,21 @@ defmodule HeliumConfigWeb.OrganizationViewTest do
%{port: 1009, region: "AS923_2"},
%{port: 10010, region: "AS923_3"},
%{port: 10011, region: "AS923_4"},
%{port: 10012, region: "AS923_1B"},
%{port: 10013, region: "CD900_1A"}
%{port: 10012, region: "AS923_1A"},
%{port: 10013, region: "AS923_1B"},
%{port: 10014, region: "AS923_1C"},
%{port: 10015, region: "AS923_1D"},
%{port: 10016, region: "AS923_1E"},
%{port: 10017, region: "AS923_1F"},
%{port: 10018, region: "AU915_SB1"},
%{port: 10019, region: "AU915_SB2"},
%{port: 10020, region: "EU868_A"},
%{port: 10021, region: "EU868_B"},
%{port: 10022, region: "EU868_C"},
%{port: 10023, region: "EU868_D"},
%{port: 10024, region: "EU868_E"},
%{port: 10025, region: "EU868_F"},
%{port: 10026, region: "CD900_1A"}
],
type: "gwmp"
}
Expand Down
17 changes: 15 additions & 2 deletions test/support/helium_config_fixtures.ex
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,21 @@ defmodule HeliumConfig.Fixtures do
{:AS923_2, 1009},
{:AS923_3, 10010},
{:AS923_4, 10011},
{:AS923_1B, 10012},
{:CD900_1A, 10013}
{:AS923_1A, 10012},
{:AS923_1B, 10013},
{:AS923_1C, 10014},
{:AS923_1D, 10015},
{:AS923_1E, 10016},
{:AS923_1F, 10017},
{:AU915_SB1, 10018},
{:AU915_SB2, 10019},
{:EU868_A, 10020},
{:EU868_B, 10021},
{:EU868_C, 10022},
{:EU868_D, 10023},
{:EU868_E, 10024},
{:EU868_F, 10025},
{:CD900_1A, 10026}
]
}
})
Expand Down