Skip to content
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
2 changes: 2 additions & 0 deletions api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3370,6 +3370,8 @@ This is used internally by the Network Server.
| `desired_beacon_frequency` | [`FrequencyValue`](#ttn.lorawan.v3.FrequencyValue) | | The frequency of the class B beacon (Hz) Network Server should configure device to use via MAC commands. If unset, the default value from Network Server configuration will be used. |
| `desired_max_eirp` | [`DeviceEIRPValue`](#ttn.lorawan.v3.DeviceEIRPValue) | | Maximum EIRP (dBm). If unset, the default value from regional parameters specification will be used. |
| `class_b_c_downlink_interval` | [`google.protobuf.Duration`](#google.protobuf.Duration) | | The minimum duration passed before a network-initiated(e.g. Class B or C) downlink following an arbitrary downlink. |
| `uplink_dwell_time` | [`BoolValue`](#ttn.lorawan.v3.BoolValue) | | Whether uplink dwell time is set (400ms). If unset, the default value from Network Server configuration or regional parameters specification will be used. |
| `downlink_dwell_time` | [`BoolValue`](#ttn.lorawan.v3.BoolValue) | | Whether downlink dwell time is set (400ms). If unset, the default value from Network Server configuration or regional parameters specification will be used. |

#### Field Rules

Expand Down
8 changes: 8 additions & 0 deletions api/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -15920,6 +15920,14 @@
"class_b_c_downlink_interval": {
"type": "string",
"description": "The minimum duration passed before a network-initiated(e.g. Class B or C) downlink following an arbitrary downlink."
},
"uplink_dwell_time": {
"$ref": "#/definitions/lorawanv3BoolValue",
"description": "Whether uplink dwell time is set (400ms).\nIf unset, the default value from Network Server configuration or regional parameters specification will be used."
},
"downlink_dwell_time": {
"$ref": "#/definitions/lorawanv3BoolValue",
"description": "Whether downlink dwell time is set (400ms).\nIf unset, the default value from Network Server configuration or regional parameters specification will be used."
}
}
},
Expand Down
7 changes: 7 additions & 0 deletions api/end_device.proto
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ message MACSettings {
DeviceEIRPValue desired_max_eirp = 30;
// The minimum duration passed before a network-initiated(e.g. Class B or C) downlink following an arbitrary downlink.
google.protobuf.Duration class_b_c_downlink_interval = 31;

// Whether uplink dwell time is set (400ms).
// If unset, the default value from Network Server configuration or regional parameters specification will be used.
BoolValue uplink_dwell_time = 32;
// Whether downlink dwell time is set (400ms).
// If unset, the default value from Network Server configuration or regional parameters specification will be used.
BoolValue downlink_dwell_time = 33;
}

// MACState represents the state of MAC layer of the device.
Expand Down
7 changes: 7 additions & 0 deletions pkg/band/as_923_rp1_v1_0_2_rev_b.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,11 @@ var AS_923_RP1_v1_0_2_RevB = Band{
PingSlotFrequency: uint64Ptr(as923BeaconFrequency(as923Group1Offset)),

TxParamSetupReqSupport: true,

// Based on LoRaMac-node 4.4.1.
// https://github.com/Lora-net/LoRaMac-node/blob/1cdd9ccec4c9f05b616e7112059be4a9e358c571/src/mac/region/RegionAS923.h#L116-L124
BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(true),
},
}
8 changes: 8 additions & 0 deletions pkg/band/as_923_rp1_v1_0_3_rev_a.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,12 @@ var AS_923_RP1_v1_0_3_RevA = Band{
PingSlotFrequency: uint64Ptr(as923BeaconFrequency(as923Group1Offset)),

TxParamSetupReqSupport: true,

// Based on LoRaMac-node 4.4.7.
// https://github.com/Lora-net/LoRaMac-node/blob/e54d3ecf3407c2b9a0abe86ce406de76b2b5a180/src/mac/region/RegionAS923.h#L142-L145
// https://github.com/Lora-net/LoRaMac-node/blob/e54d3ecf3407c2b9a0abe86ce406de76b2b5a180/src/mac/region/RegionCommon.h#L102-L105
BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
8 changes: 8 additions & 0 deletions pkg/band/as_923_rp2_v1_0_1.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,13 @@ var as923RP2101Band = func(id string, offset as923GroupOffset) Band {
PingSlotFrequency: uint64Ptr(as923BeaconFrequency(offset)),

TxParamSetupReqSupport: true,

// Based on LoRaMac-node 4.6.0.
// https://github.com/Lora-net/LoRaMac-node/blob/fe8247e2b84101fe701531a5f9ef14f035743af4/src/mac/region/RegionAS923.h#L161-L164
// https://github.com/Lora-net/LoRaMac-node/blob/fe8247e2b84101fe701531a5f9ef14f035743af4/src/mac/region/RegionCommon.h#L97-L100
BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp1_v1_0_3_rev_a.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,9 @@ var AU_915_928_RP1_v1_0_3_RevA = Band{
},

TxParamSetupReqSupport: true,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp1_v1_1_rev_a.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ var AU_915_928_RP1_v1_1_RevA = Band{
},

TxParamSetupReqSupport: false,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp1_v1_1_rev_b.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ var AU_915_928_RP1_v1_1_RevB = Band{
},

TxParamSetupReqSupport: true,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp2_v1_0_0.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ var AU_915_928_RP2_v1_0_0 = Band{
},

TxParamSetupReqSupport: true,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp2_v1_0_1.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ var AU_915_928_RP2_v1_0_1 = Band{
},

TxParamSetupReqSupport: true,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
5 changes: 5 additions & 0 deletions pkg/band/au_915_928_rp2_v1_0_2.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ var AU_915_928_RP2_v1_0_2 = Band{
},

TxParamSetupReqSupport: true,

BootDwellTime: DwellTime{
Uplinks: boolPtr(true),
Downlinks: boolPtr(false),
},
}
11 changes: 11 additions & 0 deletions pkg/band/band.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ type Band struct {

// DefaultRx2Parameters are the default parameters that determine the settings for a Tx sent during Rx2.
DefaultRx2Parameters Rx2Parameters

// BootDwellTime contains the dwell time values expected for a device on boot.
BootDwellTime DwellTime
}

// DwellTime contains the band dwell time settings.
type DwellTime struct {
Uplinks *bool
Downlinks *bool
}

// MaxTxPowerIndex returns the maximum TxPower index for the band.
Expand Down Expand Up @@ -154,3 +163,5 @@ func (b Band) FindDownlinkDataRate(dr *ttnpb.DataRate) (ttnpb.DataRateIndex, Dat
}
return 0, DataRate{}, false
}

func boolPtr(v bool) *bool { return &v }
4 changes: 4 additions & 0 deletions pkg/band/reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ type serializableBand struct {
Rx1DataRate map[string]ttnpb.DataRateIndex

DefaultRx2Parameters band.Rx2Parameters

BootDwellTime band.DwellTime
}

func makeRx1Channel(f func(uint8) (uint8, error)) map[uint8]uint8 {
Expand Down Expand Up @@ -216,6 +218,8 @@ func makeBand(b band.Band) serializableBand {
// Missing: ParseChMask

DefaultRx2Parameters: b.DefaultRx2Parameters,

BootDwellTime: b.BootDwellTime,
}
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_2_RP002_V1_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 921400000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_2_RP002_V1_0_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 921400000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_3_RP002_V1_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 916600000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_3_RP002_V1_0_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 916600000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_PHY_V1_0_2_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,5 +681,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_PHY_V1_0_2_REV_B.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": true
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_PHY_V1_0_3_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_PHY_V1_1_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_PHY_V1_1_REV_B.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_RP002_V1_0_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_RP002_V1_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AS_923_RP002_V1_0_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 2,
"Frequency": 923200000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,5 +931,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_0_2_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,5 +931,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_0_2_REV_B.json
Original file line number Diff line number Diff line change
Expand Up @@ -955,5 +955,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": null,
"Downlinks": null
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_0_3_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -960,5 +960,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_1_REV_A.json
Original file line number Diff line number Diff line change
Expand Up @@ -955,5 +955,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_PHY_V1_1_REV_B.json
Original file line number Diff line number Diff line change
Expand Up @@ -959,5 +959,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_RP002_V1_0_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -959,5 +959,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
4 changes: 4 additions & 0 deletions pkg/band/testdata/AU_915_928_RP002_V1_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -959,5 +959,9 @@
"DefaultRx2Parameters": {
"DataRateIndex": 8,
"Frequency": 923300000
},
"BootDwellTime": {
"Uplinks": true,
"Downlinks": false
}
}
Loading