Skip to content

Commit 0601d8d

Browse files
committed
Take default freq's of ch0 and ch1 into account.
1 parent 1c17713 commit 0601d8d

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/TheThingsNetwork.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,10 @@ void TheThingsNetwork::configureUS915(uint8_t fsb)
657657

658658
void TheThingsNetwork::configureAS920_923()
659659
{
660+
/* RN2903AS 1.0.3rc9 defaults
661+
* CH0 = 923.2MHz
662+
* CH1 = 923.4MHz
663+
*/
660664
sendMacSet(MAC_ADR, "off"); // TODO: remove when ADR is implemented for this plan
661665
sendMacSet(MAC_RX2, "2 923200000");
662666

@@ -686,11 +690,15 @@ void TheThingsNetwork::configureAS920_923()
686690

687691
void TheThingsNetwork::configureAS923_925()
688692
{
693+
/* RN2903AS 1.0.3rc9 defaults
694+
* CH0 = 923.2MHz
695+
* CH1 = 923.4MHz
696+
*/
689697
sendMacSet(MAC_ADR, "off"); // TODO: remove when ADR is implemented for this plan
690698
sendMacSet(MAC_RX2, "2 923200000");
691699

692700
char buf[10];
693-
uint32_t freq = 923200000;
701+
uint32_t freq = 923600000;
694702
uint8_t ch;
695703
for (ch = 0; ch < 8; ch++)
696704
{
@@ -718,20 +726,21 @@ void TheThingsNetwork::configureKR920_923()
718726
sendMacSet(MAC_ADR, "off"); // TODO: remove when ADR is implemented for this plan
719727
sendMacSet(MAC_RX2, "0 921900000"); // KR still uses SF12 for now. Might change to SF9 later.
720728

729+
//disable two default LoRaWAN channels
730+
sendChSet(MAC_CHANNEL_STATUS, 0, "off");
731+
sendChSet(MAC_CHANNEL_STATUS, 1, "off");
732+
721733
char buf[10];
722734
uint32_t freq = 922100000;
723735
uint8_t ch;
724-
for (ch = 0; ch < 8; ch++)
736+
for (ch = 2; ch < 9; ch++)
725737
{
726738
sendChSet(MAC_CHANNEL_DCYCLE, ch, "799");
727-
if (ch > 1)
728-
{
729-
sprintf(buf, "%lu", freq);
730-
sendChSet(MAC_CHANNEL_FREQ, ch, buf);
731-
sendChSet(MAC_CHANNEL_DRRANGE, ch, "0 5");
732-
sendChSet(MAC_CHANNEL_STATUS, ch, "on");
733-
freq = freq + 200000;
734-
}
739+
sprintf(buf, "%lu", freq);
740+
sendChSet(MAC_CHANNEL_FREQ, ch, buf);
741+
sendChSet(MAC_CHANNEL_DRRANGE, ch, "0 5");
742+
sendChSet(MAC_CHANNEL_STATUS, ch, "on");
743+
freq = freq + 200000;
735744
}
736745
sendMacSet(MAC_PWRIDX, TTN_PWRIDX_KR920_923);
737746
}

0 commit comments

Comments
 (0)