|
| 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