Skip to content

Commit 4edb771

Browse files
iamemiliodeadprogram
authored andcommitted
fix lora us915 logic to step into 500 kHz range
1 parent e95cfe6 commit 4edb771

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lora/lorawan/region/us915.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,21 @@ func (c *ChannelUS) Next() bool {
3232
freq, ok := stepFrequency125(c.frequency)
3333
if ok {
3434
c.frequency = freq
35-
return true
3635
} else {
3736
c.frequency = lora.Mhz_903_0
38-
return true
37+
c.bandwidth = lora.Bandwidth_500_0
3938
}
4039
case lora.Bandwidth_500_0:
4140
freq, ok := stepFrequency500(c.frequency)
4241
if ok {
4342
c.frequency = freq
44-
return true
4543
} else {
44+
// there are no more frequencies to check after sweeping all 8 500 kHz channels
4645
return false
4746
}
4847
}
4948

50-
return false
49+
return true
5150
}
5251

5352
func stepFrequency125(freq uint32) (uint32, bool) {

0 commit comments

Comments
 (0)