Skip to content

Commit

Permalink
Merge pull request #235 from TheThingsNetwork/feature/au915
Browse files Browse the repository at this point in the history
AU915 support
  • Loading branch information
johanstokking authored May 3, 2018
2 parents 20d6964 + 04e2a33 commit 98485a4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
Binary file added docs/RN2903A-1.0.3-AU915.zip
Binary file not shown.
Binary file added docs/RN2903A-programming.docx
Binary file not shown.
Binary file added docs/RN2903A-uart-bootloader.docx
Binary file not shown.
28 changes: 28 additions & 0 deletions src/TheThingsNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,30 @@ void TheThingsNetwork::configureUS915(uint8_t fsb)
sendMacSet(MAC_PWRIDX, TTN_PWRIDX_US915);
}

void TheThingsNetwork::configureAU915(uint8_t fsb)
{
uint8_t ch;
uint8_t chLow = fsb > 0 ? (fsb - 1) * 8 : 0;
uint8_t chHigh = fsb > 0 ? chLow + 7 : 71;
uint8_t ch500 = fsb + 63;
for (ch = 0; ch < 72; ch++)
{
if (ch == ch500 || (ch <= chHigh && ch >= chLow))
{
sendChSet(MAC_CHANNEL_STATUS, ch, "on");
if (ch < 63)
{
sendChSet(MAC_CHANNEL_DRRANGE, ch, "0 3");
}
}
else
{
sendChSet(MAC_CHANNEL_STATUS, ch, "off");
}
}
sendMacSet(MAC_PWRIDX, TTN_PWRIDX_AU915);
}

void TheThingsNetwork::configureAS920_923()
{
/* RN2903AS 1.0.3rc9 defaults
Expand Down Expand Up @@ -759,6 +783,9 @@ void TheThingsNetwork::configureChannels(uint8_t fsb)
case TTN_FP_US915:
configureUS915(fsb);
break;
case TTN_FP_AU915:
configureAU915(fsb);
break;
case TTN_FP_AS920_923:
configureAS920_923();
break;
Expand All @@ -784,6 +811,7 @@ bool TheThingsNetwork::setSF(uint8_t sf)
case TTN_FP_AS920_923:
case TTN_FP_AS923_925:
case TTN_FP_KR920_923:
case TTN_FP_AU915:
dr = 12 - sf;
break;
case TTN_FP_US915:
Expand Down
3 changes: 3 additions & 0 deletions src/TheThingsNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#define TTN_PWRIDX_EU868 "1"
#define TTN_PWRIDX_US915 "5"
#define TTN_PWRIDX_AU915 "5"
#define TTN_PWRIDX_AS920_923 "1" // TODO: should be 0, but the current RN2903AS firmware doesn't accept that value (probably still using EU868: 1=14dBm)
#define TTN_PWRIDX_AS923_925 "1" // TODO: should be 0
#define TTN_PWRIDX_KR920_923 "1" // TODO: should be 0
Expand All @@ -34,6 +35,7 @@ enum ttn_fp_t
{
TTN_FP_EU868,
TTN_FP_US915,
TTN_FP_AU915,
TTN_FP_AS920_923,
TTN_FP_AS923_925,
TTN_FP_KR920_923
Expand Down Expand Up @@ -63,6 +65,7 @@ class TheThingsNetwork
void autoBaud();
void configureEU868();
void configureUS915(uint8_t fsb);
void configureAU915(uint8_t fsb);
void configureAS920_923();
void configureAS923_925();
void configureKR920_923();
Expand Down

0 comments on commit 98485a4

Please sign in to comment.