Skip to content

Commit d27b6a4

Browse files
committed
dev: Add UZ_923_DRAFT band
1 parent b22b451 commit d27b6a4

File tree

4 files changed

+178
-0
lines changed

4 files changed

+178
-0
lines changed

pkg/band/all.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,20 @@ var (
214214
ttnpb.PHYVersion_RP002_V1_0_3: US_902_928_RP2_V1_0_3,
215215
ttnpb.PHYVersion_RP002_V1_0_4: US_902_928_RP2_V1_0_4,
216216
},
217+
UZ_923_DRAFT: {
218+
ttnpb.PHYVersion_TS001_V1_0: UZ_923_Draft_Universal,
219+
ttnpb.PHYVersion_TS001_V1_0_1: UZ_923_Draft_Universal,
220+
ttnpb.PHYVersion_RP001_V1_0_2: UZ_923_Draft_Universal,
221+
ttnpb.PHYVersion_RP001_V1_0_2_REV_B: UZ_923_Draft_Universal,
222+
ttnpb.PHYVersion_RP001_V1_0_3_REV_A: UZ_923_Draft_Universal,
223+
ttnpb.PHYVersion_RP001_V1_1_REV_A: UZ_923_Draft_Universal,
224+
ttnpb.PHYVersion_RP001_V1_1_REV_B: UZ_923_Draft_Universal,
225+
ttnpb.PHYVersion_RP002_V1_0_0: UZ_923_Draft_Universal,
226+
ttnpb.PHYVersion_RP002_V1_0_1: UZ_923_Draft_Universal,
227+
ttnpb.PHYVersion_RP002_V1_0_2: UZ_923_Draft_Universal,
228+
ttnpb.PHYVersion_RP002_V1_0_3: UZ_923_Draft_Universal,
229+
ttnpb.PHYVersion_RP002_V1_0_4: UZ_923_Draft_Universal,
230+
},
217231
}
218232

219233
// LatestVersion contains the latest version of each band.
@@ -237,6 +251,7 @@ var (
237251
MA_869_870_DRAFT: ttnpb.PHYVersion_RP002_V1_0_4,
238252
RU_864_870: ttnpb.PHYVersion_RP002_V1_0_4,
239253
US_902_928: ttnpb.PHYVersion_RP002_V1_0_4,
254+
UZ_923_DRAFT: ttnpb.PHYVersion_RP002_V1_0_4,
240255
}
241256
)
242257

pkg/band/rpc_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,23 @@ func TestGetPhyVersions(t *testing.T) {
372372
ttnpb.PHYVersion_TS001_V1_0,
373373
},
374374
},
375+
{
376+
BandId: "UZ_923_DRAFT",
377+
PhyVersions: []ttnpb.PHYVersion{
378+
ttnpb.PHYVersion_RP002_V1_0_4,
379+
ttnpb.PHYVersion_RP002_V1_0_3,
380+
ttnpb.PHYVersion_RP002_V1_0_2,
381+
ttnpb.PHYVersion_RP002_V1_0_1,
382+
ttnpb.PHYVersion_RP002_V1_0_0,
383+
ttnpb.PHYVersion_RP001_V1_0_3_REV_A,
384+
ttnpb.PHYVersion_RP001_V1_1_REV_B,
385+
ttnpb.PHYVersion_RP001_V1_1_REV_A,
386+
ttnpb.PHYVersion_RP001_V1_0_2_REV_B,
387+
ttnpb.PHYVersion_RP001_V1_0_2,
388+
ttnpb.PHYVersion_TS001_V1_0_1,
389+
ttnpb.PHYVersion_TS001_V1_0,
390+
},
391+
},
375392
},
376393
},
377394
},
@@ -868,6 +885,9 @@ func TestListBands(t *testing.T) {
868885
MA_869_870_DRAFT: {
869886
ttnpb.PHYVersion_TS001_V1_0_1: All[MA_869_870_DRAFT][ttnpb.PHYVersion_TS001_V1_0_1],
870887
},
888+
UZ_923_DRAFT: {
889+
ttnpb.PHYVersion_TS001_V1_0_1: All[UZ_923_DRAFT][ttnpb.PHYVersion_TS001_V1_0_1],
890+
},
871891
}),
872892
},
873893
},

pkg/band/uz_923_draft.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright © 2025 The Things Network Foundation, The Things Industries B.V.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package band
16+
17+
import "go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
18+
19+
const (
20+
// UZ_923_DRAFT is the ID of the draft Uzbekistan 923Mhz band.
21+
UZ_923_DRAFT = "UZ_923_DRAFT"
22+
)
23+
24+
var (
25+
uz923DraftBeaconFrequencies = []uint64{926600000}
26+
uz923DraftDefaultChannels = []Channel{
27+
{
28+
Frequency: 926400000,
29+
MaxDataRate: ttnpb.DataRateIndex_DATA_RATE_5,
30+
},
31+
{
32+
Frequency: 926600000,
33+
MaxDataRate: ttnpb.DataRateIndex_DATA_RATE_5,
34+
},
35+
{
36+
Frequency: 926800000,
37+
MaxDataRate: ttnpb.DataRateIndex_DATA_RATE_5,
38+
},
39+
}
40+
41+
uz923DraftDownlinkDRTable = [6][6]ttnpb.DataRateIndex{
42+
{0, 0, 0, 0, 0, 0},
43+
{1, 0, 0, 0, 0, 0},
44+
{2, 1, 0, 0, 0, 0},
45+
{3, 2, 1, 0, 0, 0},
46+
{4, 3, 2, 1, 0, 0},
47+
{5, 4, 3, 2, 1, 0},
48+
}
49+
)

pkg/band/uz_923_draft_universal.go

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright © 2025 The Things Network Foundation, The Things Industries B.V.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package band
16+
17+
import "go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
18+
19+
// UZ_923_Draft_Universal is the band definition for UZ923.
20+
var UZ_923_Draft_Universal = Band{
21+
ID: UZ_923_DRAFT,
22+
23+
SupportsDynamicADR: true,
24+
25+
MaxUplinkChannels: 16,
26+
UplinkChannels: uz923DraftDefaultChannels,
27+
28+
MaxDownlinkChannels: 16,
29+
DownlinkChannels: uz923DraftDefaultChannels,
30+
31+
SubBands: []SubBandParameters{
32+
{
33+
MinFrequency: 926200000,
34+
MaxFrequency: 926800000,
35+
DutyCycle: 0.01,
36+
MaxEIRP: 16.0,
37+
},
38+
},
39+
40+
DataRates: map[ttnpb.DataRateIndex]DataRate{
41+
ttnpb.DataRateIndex_DATA_RATE_0: makeLoRaDataRate(12, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(59)),
42+
ttnpb.DataRateIndex_DATA_RATE_1: makeLoRaDataRate(11, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(59)),
43+
ttnpb.DataRateIndex_DATA_RATE_2: makeLoRaDataRate(10, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(59)),
44+
ttnpb.DataRateIndex_DATA_RATE_3: makeLoRaDataRate(9, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(123)),
45+
ttnpb.DataRateIndex_DATA_RATE_4: makeLoRaDataRate(8, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(250)),
46+
ttnpb.DataRateIndex_DATA_RATE_5: makeLoRaDataRate(7, 125000, Cr4_5, makeConstMaxMACPayloadSizeFunc(250)),
47+
},
48+
MaxADRDataRateIndex: ttnpb.DataRateIndex_DATA_RATE_5,
49+
StrictCodingRate: true,
50+
51+
DefaultMaxEIRP: 16,
52+
TxOffset: []float32{
53+
0,
54+
-2,
55+
-4,
56+
-6,
57+
-8,
58+
-10,
59+
-12,
60+
-14,
61+
},
62+
63+
Rx1Channel: channelIndexIdentity,
64+
Rx1DataRate: func(idx ttnpb.DataRateIndex, offset ttnpb.DataRateOffset, _ bool) (ttnpb.DataRateIndex, error) {
65+
if idx > ttnpb.DataRateIndex_DATA_RATE_5 {
66+
return 0, errDataRateIndexTooHigh.WithAttributes("max", 5)
67+
}
68+
if offset > 5 {
69+
return 0, errDataRateOffsetTooHigh.WithAttributes("max", 5)
70+
}
71+
return uz923DraftDownlinkDRTable[idx][offset], nil
72+
},
73+
74+
GenerateChMasks: generateChMask16,
75+
ParseChMask: parseChMask16,
76+
77+
FreqMultiplier: 100,
78+
ImplementsCFList: true,
79+
CFListType: ttnpb.CFListType_FREQUENCIES,
80+
81+
DefaultRx2Parameters: Rx2Parameters{
82+
DataRateIndex: ttnpb.DataRateIndex_DATA_RATE_2,
83+
Frequency: 926200000,
84+
},
85+
86+
Beacon: Beacon{
87+
DataRateIndex: ttnpb.DataRateIndex_DATA_RATE_3,
88+
CodingRate: Cr4_5,
89+
Frequencies: uz923DraftBeaconFrequencies,
90+
},
91+
PingSlotFrequencies: uz923DraftBeaconFrequencies,
92+
93+
SharedParameters: universalSharedParameters,
94+
}

0 commit comments

Comments
 (0)