diff --git a/src/lora_adr.erl b/src/lora_adr.erl index 99de563..e091dd2 100644 --- a/src/lora_adr.erl +++ b/src/lora_adr.erl @@ -391,15 +391,6 @@ adr_datarates(Region) -> {4, {8, 125}}, {5, {7, 125}} ]; - 'AU915_DP' -> - [ - {0, {12, 125}}, - {1, {11, 125}}, - {2, {10, 125}}, - {3, {9, 125}}, - {4, {8, 125}}, - {5, {7, 125}} - ]; 'CN470' -> [ {0, {12, 125}}, @@ -433,12 +424,16 @@ adr_sf_range(Region) -> case Region of 'US915' -> {7, 10}; 'EU868' -> {7, 12}; + 'EU868_A' -> {7, 12}; + 'EU868_B' -> {7, 12}; 'AU915' -> {7, 12}; + 'AU915_SB1' -> {7, 12}; + 'AU915_SB2' -> {7, 12}; 'AU915_SB5' -> {7, 12}; - 'AU915_DP' -> {7, 12}; 'CN470' -> {7, 12}; 'AS923' -> {7, 12}; 'AS923_1B' -> {7, 12}; + 'AS923_1C' -> {7, 12}; _ -> {7, 12} end. @@ -446,12 +441,16 @@ adr_datarate_range(Region) -> case Region of 'US915' -> {0, 3}; 'EU868' -> {0, 5}; + 'EU868_A' -> {0, 5}; + 'EU868_B' -> {0, 5}; 'AU915' -> {0, 5}; + 'AU915_SB1' -> {0, 5}; + 'AU915_SB2' -> {0, 5}; 'AU915_SB5' -> {0, 5}; - 'AU915_DP' -> {0, 5}; 'CN470' -> {0, 5}; 'AS923' -> {0, 5}; 'AS923_1B' -> {0, 5}; + 'AS923_1C' -> {0, 5}; _ -> {0, 5} end. diff --git a/src/lora_chmask.erl b/src/lora_chmask.erl index 7980715..9fc0e55 100644 --- a/src/lora_chmask.erl +++ b/src/lora_chmask.erl @@ -86,12 +86,18 @@ join_cf_list('US915') -> cflist_type_1({8, 15}); join_cf_list('AU915') -> cflist_type_1({8, 15}); -join_cf_list('AU915_DP') -> - cflist_type_1({34, 41}); +join_cf_list('AU915_SB1') -> + cflist_type_1({0, 7}); +join_cf_list('AU915_SB2') -> + cflist_type_1({8, 15}); join_cf_list('AU915_SB5') -> cflist_type_1({40, 47}); join_cf_list('EU868') -> cflist_type_0([8671000, 8673000, 8675000, 8677000, 8679000]); +join_cf_list('EU868_A') -> + cflist_type_0([8671000, 8673000, 8675000, 8677000, 8679000]); +join_cf_list('EU868_B') -> + cflist_type_0([8671000, 8673000, 8675000, 8677000, 8679000]); join_cf_list('EU433') -> cflist_type_0([4331750, 4333750, 4335750, 0, 0]); join_cf_list('CN470') -> @@ -100,6 +106,8 @@ join_cf_list('AS923_1') -> cflist_type_0([9236000, 9238000, 9240000, 9242000, 9244000]); join_cf_list('AS923_1B') -> cflist_type_0([9220000, 9222000, 9234000, 9228000, 9230000]); +join_cf_list('AS923_1C') -> + cflist_type_0([9236000, 9238000, 9240000, 9242000, 9244000]); join_cf_list('AS923_2') -> cflist_type_0([9218000, 9220000, 9222000, 9224000, 9226000]); join_cf_list('AS923_3') -> @@ -134,7 +142,11 @@ make_link_adr_req(Region, Tuple, FOptsOut) -> %% link_adr_req command make_link_adr_req_(Region, {0, <<"NoChange">>, Chans}, FOptsOut) when - Region == 'US915'; Region == 'AU915'; Region == 'AU915_SB5'; Region == 'AU915_DP' + Region == 'US915'; + Region == 'AU915'; + Region == 'AU915_SB1'; + Region == 'AU915_SB2'; + Region == 'AU915_SB5' -> case all_bit({0, 63}, Chans) of true -> @@ -149,7 +161,11 @@ make_link_adr_req_(Region, {0, <<"NoChange">>, Chans}, FOptsOut) when ] end; make_link_adr_req_(Region, {TXPower, DataRate, Chans}, FOptsOut) when - Region == 'US915'; Region == 'AU915'; Region == 'AU915_SB5'; Region == 'AU915_DP' + Region == 'US915'; + Region == 'AU915'; + Region == 'AU915_SB1'; + Region == 'AU915_SB2'; + Region == 'AU915_SB5' -> Plan = lora_plan:region_to_plan(Region), DRIndex = lora_plan:datarate_to_index(Plan, DataRate), @@ -256,14 +272,20 @@ build_link_adr_req(Plan, {TXPower0, DataRate}, FOptsOut) -> {link_adr_req, DRIndex1, TXPower1, 0, 7, 0} | append_mask(Region, 3, {TXPower1, DataRate, Chans}, FOptsOut) ]; - 'AU915_SB5' -> - Chans = [{40, 47}], + 'AU915_SB1' -> + Chans = [{0, 7}], + [ + {link_adr_req, DRIndex1, TXPower1, 0, 7, 0} + | append_mask(Region, 3, {TXPower1, DataRate, Chans}, FOptsOut) + ]; + 'AU915_SB2' -> + Chans = [{8, 15}], [ {link_adr_req, DRIndex1, TXPower1, 0, 7, 0} | append_mask(Region, 3, {TXPower1, DataRate, Chans}, FOptsOut) ]; - 'AU915_DP' -> - Chans = [{34, 41}], + 'AU915_SB5' -> + Chans = [{40, 47}], [ {link_adr_req, DRIndex1, TXPower1, 0, 7, 0} | append_mask(Region, 3, {TXPower1, DataRate, Chans}, FOptsOut) @@ -386,8 +408,9 @@ validate_req(Plan, TxPower, DataRate) -> case Region of 'US915' -> [{8, 15}]; 'AU915' -> [{8, 15}]; + 'AU915_SB1' -> [{0, 7}]; + 'AU915_SB2' -> [{8, 15}]; 'AU915_SB5' -> [{40, 47}]; - 'AU915_DP' -> [{34, 41}]; _ -> [{0, 7}] end, M1 = make_link_adr_req(Region, {TxPower, DataRate, Chans}, []), @@ -405,12 +428,16 @@ exercise_req({Region, TxPower, DataRate}) -> exercise_req_test_() -> Regions = [ 'EU868', + 'EU868_B', 'US915', 'AU915', + 'AU915_SB1', + 'AU915_SB2', 'AU915_SB5', 'CN470', 'AS923_1', 'AS923_1B', + 'AS923_1C', 'KR920', 'IN865', 'EU433' @@ -446,6 +473,11 @@ join_cf_list_test_() -> <<0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>, join_cf_list('AU915') ), + ?_assertEqual( + %% Active Channels 8-15 + <<255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>, + join_cf_list('AU915_SB1') + ), ?_assertEqual( %% Active Channels 40-47 <<0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>, @@ -461,6 +493,11 @@ join_cf_list_test_() -> <<160, 175, 140, 112, 183, 140, 80, 230, 140, 224, 206, 140, 176, 214, 140, 0>>, join_cf_list('AS923_1B') ), + ?_assertEqual( + %% Freqs 923.6, 923.8, 924.0, 924.2, 924.4 + <<32, 238, 140, 240, 245, 140, 192, 253, 140, 144, 5, 141, 96, 13, 141, 0>>, + join_cf_list('AS923_1C') + ), ?_assertEqual( %% Freqs 921.8, 922.0, 922.2, 922.4, 922.6 <<208, 167, 140, 160, 175, 140, 112, 183, 140, 64, 191, 140, 16, 199, 140, 0>>, diff --git a/src/lora_plan.erl b/src/lora_plan.erl index 38e9909..d594556 100644 --- a/src/lora_plan.erl +++ b/src/lora_plan.erl @@ -37,20 +37,21 @@ round_frequency/2, nearest/2, plan_eu868_A/0, + plan_eu868_B/0, plan_eu433_A/0, plan_us915_SB2/0, + plan_au915_SB1/0, plan_au915_SB2/0, - plan_au915_DP/0, plan_au915_SB5/0, plan_cn470_A/0, plan_kr920_A/0, plan_in865_A/0, - plan_as923_A/0, plan_as923_1A/0, + plan_as923_1B/0, + plan_as923_1C/0, plan_as923_2A/0, plan_as923_3A/0, - plan_as923_4A/0, - plan_as923_1B/0 + plan_as923_4A/0 ]). -endif. @@ -60,31 +61,36 @@ region_to_plan(Region) -> case Region of 'EU868' -> plan_eu868_A(); + 'EU868_A' -> plan_eu868_A(); + 'EU868_B' -> plan_eu868_B(); 'EU433' -> plan_eu433_A(); 'US915' -> plan_us915_SB2(); 'AU915' -> plan_au915_SB2(); - 'AU915_DP' -> plan_au915_DP(); + 'AU915_SB1' -> plan_au915_SB1(); 'AU915_SB2' -> plan_au915_SB2(); 'AU915_SB5' -> plan_au915_SB5(); 'CN470' -> plan_cn470_A(); 'KR920' -> plan_kr920_A(); 'IN865' -> plan_in865_A(); - 'AS923' -> plan_as923_A(); + 'AS923' -> plan_as923_1A(); 'AS923_1' -> plan_as923_1A(); 'AS923_2' -> plan_as923_2A(); 'AS923_3' -> plan_as923_3A(); 'AS923_4' -> plan_as923_4A(); - 'AS923_1B' -> plan_as923_1B() + 'AS923_1B' -> plan_as923_1B(); + 'AS923_1C' -> plan_as923_1C() end. -spec valid_region(atom()) -> boolean(). valid_region(Region) -> case Region of 'EU868' -> true; + 'EU868_A' -> true; + 'EU868_B' -> true; 'EU433' -> true; 'US915' -> true; 'AU915' -> true; - 'AU915_DP' -> true; + 'AU915_SB1' -> true; 'AU915_SB2' -> true; 'AU915_SB5' -> true; 'CN470' -> true; @@ -96,6 +102,7 @@ valid_region(Region) -> 'AS923_3' -> true; 'AS923_4' -> true; 'AS923_1B' -> true; + 'AS923_1C' -> true; _ -> false end. @@ -244,7 +251,7 @@ up_to_down_datarate(Plan, Index, Offset) -> % Respond with RX2 default datarate _Class:_Reason:_Stacktrace -> lager:error( - "lora_plan=up_to_down_datarate unknown datarate index Region=~p Index=~p Offset=~p~n", + "lora_plan=up_to_down_datarate unkn datarate index Region=~p Index=~p Offset=~p~n", [ Region, Index, Offset ] @@ -263,7 +270,7 @@ dr_offset_list(Region, Index) when Region == 'US915' -> 5 -> [10, 9, 8, 8]; 6 -> [11, 10, 9, 8] end; -dr_offset_list(Region, Index) when Region == 'AU915'; Region == 'AU915_SB5'; Region == 'AU915_DP' -> +dr_offset_list(Region, Index) when Region == 'AU915'; Region == 'AU915_SB5' -> case Index of 0 -> [8, 8, 8, 8, 8, 8]; 1 -> [9, 8, 8, 8, 8, 8]; @@ -595,7 +602,6 @@ rx2_tuple(Plan) -> %% Start -spec dualplan_region(atom(), number(), data_rate()) -> atom(). dualplan_region(GatewayRegion, Freq, _DataRate) -> - DP_List = [922.0, 922.2, 922.4, 922.6, 922.8, 923.0], SB5_List = [923.6, 923.8, 924.0, 924.2, 924.4, 924.6], case GatewayRegion of 'AS923_1' -> @@ -604,10 +610,10 @@ dualplan_region(GatewayRegion, Freq, _DataRate) -> true -> 'AU915_SB5'; false -> GatewayRegion end; - 'AS923_1B' -> - IsAU915DP = find_frequency(Freq, DP_List), - case IsAU915DP of - true -> 'AU915_DP'; + 'AS923_1C' -> + IsAU915_1C = find_frequency(Freq, SB5_List), + case IsAU915_1C of + true -> 'AU915_SB5'; false -> GatewayRegion end; _ -> @@ -740,6 +746,53 @@ plan_eu868_A() -> d_channels = [867.1, 867.3, 867.5, 867.7, 867.9, 868.1, 868.3, 868.5], channel_count = 8, bank_offset = 0, + join_channels = {5, 7}, + data_rates = [ + 'SF12BW125', + 'SF11BW125', + 'SF10BW125', + 'SF9BW125', + 'SF8BW125', + 'SF7BW125', + 'SF7BW250', + 'FSK50', + 'LRFHSS1BW137', + 'LRFHSS2BW137', + 'LRFHSS1BW336', + 'LRFHSS2BW336' + ], + tx_power = [0, -2, -4, -6, -8, -10, -12, -14], + payload_max = [51, 51, 51, 115, 242, 242, 242, 242, 50, 115, 50, 115, 0, 0, 0, 0], + join_dr = {0, 5}, + mask_dr = {0, 5}, + mandatory_dr = {0, 5}, + optional_dr = {6, 7}, + max_duty_cycle = 1, + uplink_dwell_time = 0, + downlink_dwell_time = 0, + tx_param_setup_allowed = false, + max_eirp_db = 16, + rx1_offset = {0, 5}, + rx2_datarate = 0, + rx2_freq = 869.525, + beacon_freq = 869.525, + pingslot_freq = 869.525 + }, + Plan. + +plan_eu868_B() -> + Plan = #channel_plan{ + channel_plan_id = 1, + plan_name = 'EU868_B', + base_region = 'EU868_B', + dynamic_plan = true, + float_precision = 1, + min_freq = 863.0, + max_freq = 870.0, + u_channels = [868.1, 868.3, 868.5], + d_channels = [868.1, 868.3, 868.5], + channel_count = 3, + bank_offset = 0, join_channels = {0, 2}, data_rates = [ 'SF12BW125', @@ -870,18 +923,18 @@ plan_us915_SB2() -> }, Plan. -plan_au915_SB2() -> +plan_au915_SB1() -> Plan = #channel_plan{ channel_plan_id = 5, - plan_name = 'AU915_SB2', - base_region = 'AU915', + plan_name = 'AU915_SB1', + base_region = 'AU915_SB1', dynamic_plan = false, float_precision = 1, min_freq = 915.0, max_freq = 928.0, %% AU915's subbank two set of channels - %% Channel 65 (fat channel) is 917.5 Mhz - u_channels = [916.8, 917.0, 917.2, 917.4, 917.6, 917.8, 918.0, 918.2, 917.5], + %% Channel 65 (fat channel) is 915.9 Mhz + u_channels = [915.2, 915.4, 915.6, 915.8, 916.0, 916.2, 916.4, 916.6, 915.9], %% The eight AU915 downlink channels are hard-coded in the spec d_channels = [923.3, 923.9, 924.5, 925.1, 925.7, 926.3, 926.9, 927.5, 923.9], channel_count = 9, @@ -923,20 +976,21 @@ plan_au915_SB2() -> }, Plan. -plan_au915_DP() -> +plan_au915_SB2() -> Plan = #channel_plan{ channel_plan_id = 5, - plan_name = 'AU915_DP', - base_region = 'AU915_DP', + plan_name = 'AU915_SB2', + base_region = 'AU915', dynamic_plan = false, float_precision = 1, min_freq = 915.0, max_freq = 928.0, - %% AU915's subbank five set of channels + %% AU915's subbank two set of channels %% Channel 65 (fat channel) is 917.5 Mhz - u_channels = [922.0, 922.2, 922.4, 922.6, 922.8, 923.0, 923.2, 923.4], - d_channels = [924.5, 925.1, 925.7, 926.3, 926.9, 927.5, 923.3, 923.9], - channel_count = 8, + u_channels = [916.8, 917.0, 917.2, 917.4, 917.6, 917.8, 918.0, 918.2, 917.5], + %% The eight AU915 downlink channels are hard-coded in the spec + d_channels = [923.3, 923.9, 924.5, 925.1, 925.7, 926.3, 926.9, 927.5, 923.9], + channel_count = 9, bank_offset = 8, join_channels = {0, 7}, data_rates = [ @@ -1068,11 +1122,11 @@ plan_cn470_A() -> }, Plan. -plan_as923_A() -> +plan_as923_1A() -> Plan = #channel_plan{ channel_plan_id = 7, plan_name = 'AS923_1A', - base_region = 'AS923', + base_region = 'AS923_1', dynamic_plan = true, float_precision = 1, min_freq = 915.0, @@ -1115,20 +1169,24 @@ plan_as923_A() -> }, Plan. -plan_as923_1A() -> +%% +%% Defined from https://docs.google.com/spreadsheets/d/1Mw3qtSNLz4kSjJXZwptnw_pqbYAaxPrpXLsVKQrOY_U +%% and https://docs.google.com/document/d/1ImdqnNkD7BDE8ocKvUI1M8Bke8GtTuFsMCcFcEGTEQk +%% +plan_as923_1B() -> Plan = #channel_plan{ channel_plan_id = 7, - plan_name = 'AS923_1A', - base_region = 'AS923_1', + plan_name = 'AS923_1B', + base_region = 'AS923_1B', dynamic_plan = true, float_precision = 1, - min_freq = 915.0, - max_freq = 928.0, - u_channels = [923.2, 923.4, 923.6, 923.8, 924.0, 924.2, 924.4, 924.6], - d_channels = [923.2, 923.4, 923.6, 923.8, 924.0, 924.2, 924.4, 924.6], + min_freq = 919.0, + max_freq = 924.0, + u_channels = [922.0, 922.2, 922.4, 922.6, 922.8, 923.0, 923.2, 923.4], + d_channels = [919.2, 919.4, 919.6, 919.8, 920.0, 920.2, 920.4, 920.6], channel_count = 8, bank_offset = 0, - join_channels = {0, 1}, + join_channels = {6, 7}, data_rates = [ 'SF12BW125', 'SF11BW125', @@ -1153,7 +1211,7 @@ plan_as923_1A() -> uplink_dwell_time = 400, downlink_dwell_time = 400, tx_param_setup_allowed = true, - max_eirp_db = 16, + max_eirp_db = 22, rx1_offset = {0, 7}, rx2_datarate = 2, rx2_freq = 923.2, @@ -1162,24 +1220,20 @@ plan_as923_1A() -> }, Plan. -%% -%% Defined from https://docs.google.com/spreadsheets/d/1Mw3qtSNLz4kSjJXZwptnw_pqbYAaxPrpXLsVKQrOY_U -%% and https://docs.google.com/document/d/1ImdqnNkD7BDE8ocKvUI1M8Bke8GtTuFsMCcFcEGTEQk -%% -plan_as923_1B() -> +plan_as923_1C() -> Plan = #channel_plan{ channel_plan_id = 7, - plan_name = 'AS923_1B', - base_region = 'AS923_1B', + plan_name = 'AS923_1C', + base_region = 'AS923_1C', dynamic_plan = true, float_precision = 1, - min_freq = 919.0, - max_freq = 924.0, - u_channels = [922.0, 922.2, 922.4, 922.6, 922.8, 923.0, 923.2, 923.4], - d_channels = [919.2, 919.4, 919.6, 919.8, 920.0, 920.2, 920.4, 920.6], + min_freq = 915.0, + max_freq = 928.0, + u_channels = [923.2, 923.4, 923.6, 923.8, 924.0, 924.2, 924.4, 924.6], + d_channels = [923.2, 923.4, 923.6, 923.8, 924.0, 924.2, 924.4, 924.6], channel_count = 8, bank_offset = 0, - join_channels = {6, 7}, + join_channels = {0, 1}, data_rates = [ 'SF12BW125', 'SF11BW125', @@ -1201,10 +1255,10 @@ plan_as923_1B() -> mandatory_dr = {0, 5}, optional_dr = {6, 7}, max_duty_cycle = 1, - uplink_dwell_time = 400, - downlink_dwell_time = 400, + uplink_dwell_time = 0, + downlink_dwell_time = 0, tx_param_setup_allowed = true, - max_eirp_db = 16, + max_eirp_db = 27, rx1_offset = {0, 7}, rx2_datarate = 2, rx2_freq = 923.2, diff --git a/test/lora_plan_tests.erl b/test/lora_plan_tests.erl index 26e6d9a..ab1389a 100644 --- a/test/lora_plan_tests.erl +++ b/test/lora_plan_tests.erl @@ -95,7 +95,6 @@ plan_test() -> exercise_plan(lora_plan:plan_us915_SB2()), exercise_plan(lora_plan:plan_au915_SB2()), exercise_plan(lora_plan:plan_au915_SB5()), - exercise_plan(lora_plan:plan_au915_DP()), exercise_plan(lora_plan:plan_eu868_A()), exercise_plan(lora_plan:plan_as923_1A()), exercise_plan(lora_plan:plan_in865_A()), @@ -139,9 +138,10 @@ dualplan_test() -> DR = 'SF7BW125', ?assertEqual(true, lora_plan:valid_region('US915')), ?assertEqual(true, lora_plan:valid_region('AS923_1')), + ?assertEqual(true, lora_plan:valid_region('AU915_SB1')), ?assertEqual(true, lora_plan:valid_region('AU915_SB5')), - ?assertEqual(true, lora_plan:valid_region('AU915_DP')), ?assertEqual(true, lora_plan:valid_region('AS923_1B')), + ?assertEqual(true, lora_plan:valid_region('AS923_1C')), ?assertEqual(false, lora_plan:valid_region('ZZ915')), ?assertEqual('US915', lora_plan:dualplan_region('US915', 923.2, DR)), ?assertEqual('AS923_1', lora_plan:dualplan_region('AS923_1', 923.2, DR)), @@ -150,9 +150,7 @@ dualplan_test() -> ?assertEqual('AU915_SB5', lora_plan:dualplan_region('AS923_1', 923.61, DR)), ?assertEqual('AU915_SB5', lora_plan:dualplan_region('AS923_1', 923.59, DR)), ?assertEqual('AS923_1B', lora_plan:dualplan_region('AS923_1B', 923.6, DR)), - ?assertEqual('AU915_DP', lora_plan:dualplan_region('AS923_1B', 923.0, DR)), - ?assertEqual('AU915_DP', lora_plan:dualplan_region('AS923_1B', 923.01, DR)), - ?assertEqual('AU915_DP', lora_plan:dualplan_region('AS923_1B', 922.96, DR)), + ?assertEqual('AS923_1C', lora_plan:dualplan_region('AS923_1C', 923.2, DR)), ?assertEqual('AS923_1', lora_plan:dualplan_region('AS923_1', 923.0, DR)), ?assertEqual('AS923_1', lora_plan:dualplan_region('AS923_1', 924.8, DR)). diff --git a/test/test_region.erl b/test/test_region.erl index 2b72d34..1c84c7e 100644 --- a/test/test_region.erl +++ b/test/test_region.erl @@ -254,7 +254,6 @@ max_payload_size(Region, DR) -> 'AU915' -> maps:get(DR, ?AU915_PAYLOAD_SIZE_MAP, ?AU915_MAX_DOWNLINK_SIZE); 'AU915_SB2' -> maps:get(DR, ?AU915_PAYLOAD_SIZE_MAP, ?AU915_MAX_DOWNLINK_SIZE); 'AU915_SB5' -> maps:get(DR, ?AU915_PAYLOAD_SIZE_MAP, ?AU915_MAX_DOWNLINK_SIZE); - 'AU915_DP' -> maps:get(DR, ?AU915_PAYLOAD_SIZE_MAP, ?AU915_MAX_DOWNLINK_SIZE); 'EU868' -> maps:get(DR, ?EU868_PAYLOAD_SIZE_MAP, ?EU868_MAX_DOWNLINK_SIZE); 'EU433' -> maps:get(DR, ?EU433_PAYLOAD_SIZE_MAP, ?EU433_MAX_DOWNLINK_SIZE); _ -> maps:get(DR, ?US915_PAYLOAD_SIZE_MAP, ?US915_MAX_DOWNLINK_SIZE) @@ -298,10 +297,6 @@ rx1_rf(Region, #rxq{freq = Freq} = RxQ, Offset) when Region == 'AU915_SB5' -> RxCh = f2uch(Freq, {9152, 2}, {9159, 16}), DownFreq = dch2f(Region, RxCh rem 8), tx_offset(Region, RxQ, DownFreq, Offset); -rx1_rf(Region, #rxq{freq = Freq} = RxQ, Offset) when Region == 'AU915_DP' -> - RxCh = f2uch(Freq, {9152, 2}, {9159, 16}), - DownFreq = dch2f(Region, RxCh rem 8), - tx_offset(Region, RxQ, DownFreq, Offset); rx1_rf(Region, #rxq{freq = Freq} = RxQ, Offset) when Region == 'CN470' -> RxCh = f2uch(Freq, {4703, 2}), DownFreq = dch2f(Region, RxCh rem 48), @@ -370,14 +365,6 @@ rx2_rf(Region, #rxq{codr = Codr, time = Time}) when Region == 'AU915_SB2' -> }; %% 923.3. MHz / DR8 (SF12, 500 kHz) rx2_rf(Region, #rxq{codr = Codr, time = Time}) when Region == 'AU915_SB5' -> - #txq{ - freq = 923.3, - datr = dr_to_datar(Region, window2_dr(Region)), - codr = Codr, - time = Time - }; -%% 923.3. MHz / DR8 (SF12, 500 kHz) -rx2_rf(Region, #rxq{codr = Codr, time = Time}) when Region == 'AU915_DP' -> #txq{ freq = 923.3, datr = dr_to_datar(Region, window2_dr(Region)), @@ -390,7 +377,6 @@ window2_dr('US915') -> 8; window2_dr('AU915') -> 8; window2_dr('AU915_SB2') -> 8; window2_dr('AU915_SB5') -> 8; -window2_dr('AU915_DP') -> 8; window2_dr('AS923') -> 2; window2_dr('CN470') -> 0; window2_dr('EU868') -> 0; @@ -435,8 +421,6 @@ f2uch('AU915_SB2', Freq) -> f2uch(Freq, {9152, 2}, {9159, 16}); f2uch('AU915_SB5', Freq) -> f2uch(Freq, {9152, 2}, {9159, 16}); -f2uch('AU915_DP', Freq) -> - f2uch(Freq, {9152, 2}, {9159, 16}); f2uch('CN470', Freq) -> f2uch(Freq, {4073, 2}); f2uch('EU868', Freq) when Freq < 868 -> @@ -502,7 +486,6 @@ f2uch(Freq, _, {Start2, Inc2}) when round(10 * Freq - Start2) rem Inc2 == 0 -> f2dch('AU915', Freq) -> fi2ch(Freq, {9233, 6}); f2dch('AU915_SB2', Freq) -> fi2ch(Freq, {9233, 6}); f2dch('AU915_SB5', Freq) -> fi2ch(Freq, {9233, 6}); -f2dch('AU915_DP', Freq) -> fi2ch(Freq, {9233, 6}); f2dch('US915', Freq) -> fi2ch(Freq, {9233, 6}); f2dch(Region, Freq) -> f2uch(Region, Freq). @@ -555,13 +538,6 @@ uch2f('AU915_SB5', Ch) -> false -> ch2fi(Ch - 64, {9159, 16}) end; -uch2f('AU915_DP', Ch) -> - case Ch < 64 of - true -> - ch2fi(Ch, {9152, 2}); - false -> - ch2fi(Ch - 64, {9159, 16}) - end; uch2f('EU433', Ch) -> ch2fi(Ch, {4331, 2}); uch2f('EU868', Ch) -> @@ -627,8 +603,6 @@ dch2f('AU915_SB2', Ch) -> ch2fi(Ch, {9233, 6}); dch2f('AU915_SB5', Ch) -> ch2fi(Ch, {9233, 6}); -dch2f('AU915_DP', Ch) -> - ch2fi(Ch, {9233, 6}); dch2f('EU433', Ch) -> ch2fi(Ch, {4331, 2}); dch2f('EU868', Ch) -> @@ -780,16 +754,6 @@ drs_to_down(Region, DR) when Region == 'AU915_SB5' -> 5 -> [13, 12, 11, 10, 9, 8]; 6 -> [13, 13, 12, 11, 10, 9] end; -drs_to_down(Region, DR) when Region == 'AU915_DP' -> - case DR of - 0 -> [8, 8, 8, 8, 8, 8]; - 1 -> [9, 8, 8, 8, 8, 8]; - 2 -> [10, 9, 8, 8, 8, 8]; - 3 -> [11, 10, 9, 8, 8, 8]; - 4 -> [12, 11, 10, 9, 8, 8]; - 5 -> [13, 12, 11, 10, 9, 8]; - 6 -> [13, 13, 12, 11, 10, 9] - end; drs_to_down(Region, DR) when Region == 'CN470' -> case DR of 0 -> [0, 0, 0, 0, 0, 0]; @@ -855,17 +819,6 @@ datars_(Region) when Region == 'AU915_SB5' -> {6, {8, 500}, up} | us_down_datars() ]; -datars_(Region) when Region == 'AU915_DP' -> - [ - {0, {12, 125}, up}, - {1, {11, 125}, up}, - {2, {10, 125}, up}, - {3, {9, 125}, up}, - {4, {8, 125}, up}, - {5, {7, 125}, up}, - {6, {8, 500}, up} - | us_down_datars() - ]; datars_(Region) when Region == 'CN470' -> [ {0, {12, 125}, updown}, @@ -1000,8 +953,6 @@ uplink_power_table_('AU915_SB2') -> uplink_power_table_('US915'); uplink_power_table_('AU915_SB5') -> uplink_power_table_('US915'); -uplink_power_table_('AU915_DP') -> - uplink_power_table_('US915'); uplink_power_table_('CN470') -> %% NOTE: CN470's power levels are relative to the devices max power; %% they are dB, not dBm. @@ -1102,8 +1053,6 @@ freq('AU915_SB2') -> #{min => 915, max => 928}; freq('AU915_SB5') -> #{min => 915, max => 928}; -freq('AU915_DP') -> - #{min => 915, max => 928}; freq('CN470') -> #{min => 470, max => 510}; freq('AS923') -> @@ -1126,7 +1075,6 @@ net_freqs(#network{region = Region, init_chans = Chans}) when Region == 'AU915'; Region == 'AU915_SB2'; Region == 'AU915_SB5'; - Region == 'AU915_DP'; Region == 'CN470' -> %% convert enabled channels to frequencies @@ -1229,8 +1177,7 @@ set_channels_(Region, {0, <<"NoChange">>, Chans}, FOptsOut) when Region == 'US915'; Region == 'AU915'; Region == 'AU915_SB2'; - Region == 'AU915_SB5'; - Region == 'AU915_DP' + Region == 'AU915_SB5' -> case all_bit({0, 63}, Chans) of true -> @@ -1248,8 +1195,7 @@ set_channels_(Region, {TXPower, DataRate, Chans}, FOptsOut) when Region == 'US915'; Region == 'AU915'; Region == 'AU915_SB2'; - Region == 'AU915_SB5'; - Region == 'AU915_DP' + Region == 'AU915_SB5' -> case all_bit({0, 63}, Chans) of true ->