Skip to content

Commit 368793a

Browse files
Merge pull request #188 from TheThingsNetwork/fix/provision-reset
Reset on provision
2 parents 8b8a88d + 2cf2176 commit 368793a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/TheThingsNetwork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ bool TheThingsNetwork::personalize()
472472

473473
bool TheThingsNetwork::provision(const char *appEui, const char *appKey)
474474
{
475+
reset();
475476
if (strlen(appEui) != 16 || strlen(appKey) != 32)
476477
{
477478
debugPrintMessage(ERR_MESSAGE, ERR_KEY_LENGTH);
@@ -515,7 +516,6 @@ bool TheThingsNetwork::join(int8_t retries, uint32_t retryDelay)
515516

516517
bool TheThingsNetwork::join(const char *appEui, const char *appKey, int8_t retries, uint32_t retryDelay)
517518
{
518-
reset();
519519
return provision(appEui, appKey) && join(retries, retryDelay);
520520
}
521521

src/TheThingsNetwork.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class TheThingsNetwork
5353
void debugPrintIndex(uint8_t index, const char *value = NULL);
5454
void debugPrintMessage(uint8_t type, uint8_t index, const char *value = NULL);
5555

56-
void reset(bool adr = true);
5756
void autoBaud();
5857
void configureEU868(uint8_t sf);
5958
void configureUS915(uint8_t sf, uint8_t fsb);
@@ -69,6 +68,7 @@ class TheThingsNetwork
6968

7069
public:
7170
TheThingsNetwork(Stream &modemStream, Stream &debugStream, ttn_fp_t fp, uint8_t sf = TTN_DEFAULT_SF, uint8_t fsb = TTN_DEFAULT_FSB);
71+
void reset(bool adr = true);
7272
void showStatus();
7373
size_t getHardwareEui(char *buffer, size_t size);
7474
size_t getAppEui(char *buffer, size_t size);

0 commit comments

Comments
 (0)