Skip to content

Commit 68bca48

Browse files
committed
Reset on provision
1 parent 9a06bf6 commit 68bca48

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
@@ -437,6 +437,7 @@ bool TheThingsNetwork::personalize()
437437

438438
bool TheThingsNetwork::provision(const char *appEui, const char *appKey)
439439
{
440+
reset();
440441
if (strlen(appEui) != 16 || strlen(appKey) != 32)
441442
{
442443
debugPrintMessage(ERR_MESSAGE, ERR_KEY_LENGTH);
@@ -480,7 +481,6 @@ bool TheThingsNetwork::join(int8_t retries, uint32_t retryDelay)
480481

481482
bool TheThingsNetwork::join(const char *appEui, const char *appKey, int8_t retries, uint32_t retryDelay)
482483
{
483-
reset();
484484
return provision(appEui, appKey) && join(retries, retryDelay);
485485
}
486486

src/TheThingsNetwork.h

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

55-
void reset(bool adr = true);
5655
void configureEU868(uint8_t sf);
5756
void configureUS915(uint8_t sf, uint8_t fsb);
5857
void configureChannels(uint8_t sf, uint8_t fsb);
@@ -67,6 +66,7 @@ class TheThingsNetwork
6766

6867
public:
6968
TheThingsNetwork(Stream &modemStream, Stream &debugStream, ttn_fp_t fp, uint8_t sf = TTN_DEFAULT_SF, uint8_t fsb = TTN_DEFAULT_FSB);
69+
void reset(bool adr = true);
7070
void showStatus();
7171
size_t getHardwareEui(char *buffer, size_t size);
7272
void onMessage(void (*cb)(const uint8_t *payload, size_t size, port_t port));

0 commit comments

Comments
 (0)