Skip to content

Commit 4d5054b

Browse files
committed
Removed Case Statements and updated duty cycle
1 parent 62c2980 commit 4d5054b

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

src/.TheThingsNetwork.cpp.swp

-1 KB
Binary file not shown.

src/TheThingsNetwork.cpp

+19-21
Original file line numberDiff line numberDiff line change
@@ -752,33 +752,31 @@ void TheThingsNetwork::configureKR920_923()
752752
void TheThingsNetwork::configureIN865_867()
753753
{
754754
sendMacSet(MAC_ADR, "off"); // TODO: remove when ADR is implemented for this plan
755-
sendMacSet(MAC_RX2, "2 866550000"); // SF10
755+
sendMacSet(MAC_RX2, "2 866550000"); // SF10
756756

757757
// Disable the three default LoRaWAN channels
758758
sendChSet(MAC_CHANNEL_STATUS, 0, "off");
759759
sendChSet(MAC_CHANNEL_STATUS, 1, "off");
760760
sendChSet(MAC_CHANNEL_STATUS, 2, "off");
761761

762-
char buf[10];
763-
uint32_t freq = 865062500;
764-
uint8_t ch;
765-
for (ch = 3; ch < 7; ch++)
766-
{
767-
sendChSet(MAC_CHANNEL_DCYCLE, ch, "799");
768-
sprintf(buf, "%lu", freq);
769-
sendChSet(MAC_CHANNEL_FREQ, ch, buf);
770-
sendChSet(MAC_CHANNEL_DRRANGE, ch, "0 5");
771-
sendChSet(MAC_CHANNEL_STATUS, ch, "on");
772-
switch(ch)
773-
{
774-
case 4:
775-
freq = 865402500;
776-
break;
777-
case 5:
778-
freq = 865985000;
779-
break;
780-
}
781-
}
762+
// Channel 3
763+
sendChSet(MAC_CHANNEL_DCYCLE, 3, "299");
764+
sendChSet(MAC_CHANNEL_FREQ, 3, "865062500");
765+
sendChSet(MAC_CHANNEL_DRRANGE, 3, "0 5");
766+
sendChSet(MAC_CHANNEL_STATUS, 3, "on");
767+
768+
// Channel 4
769+
sendChSet(MAC_CHANNEL_DCYCLE, 4, "299");
770+
sendChSet(MAC_CHANNEL_FREQ, 4, "865402500");
771+
sendChSet(MAC_CHANNEL_DRRANGE, 4, "0 5");
772+
sendChSet(MAC_CHANNEL_STATUS, 4, "on");
773+
774+
// Channel 5
775+
sendChSet(MAC_CHANNEL_DCYCLE, 5, "299");
776+
sendChSet(MAC_CHANNEL_FREQ, 5, "865985000");
777+
sendChSet(MAC_CHANNEL_DRRANGE, 5, "0 5");
778+
sendChSet(MAC_CHANNEL_STATUS, 5, "on");
779+
782780
sendMacSet(MAC_PWRIDX, TTN_PWRIDX_IN865_867);
783781
}
784782

0 commit comments

Comments
 (0)