Skip to content

Commit 014fffa

Browse files
committed
Flexible model and version splitting
1 parent fd3d1ee commit 014fffa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/TheThingsNetwork.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,11 @@ void TheThingsNetwork::reset(bool adr)
408408

409409
size_t length = readResponse(SYS_TABLE, SYS_RESET, buffer, sizeof(buffer));
410410

411-
// buffer contains "RN2xx3 1.x.x ...", splitting model from version
412-
buffer[6] = '\0';
413-
debugPrintIndex(SHOW_MODEL, buffer);
414-
debugPrintIndex(SHOW_VERSION, buffer + 7);
411+
// buffer contains "RN2xx3[xx] x.x.x ...", splitting model from version
412+
char *model = strtok(buffer, " ");
413+
debugPrintIndex(SHOW_MODEL, model);
414+
char *version = strtok(NULL, " ");
415+
debugPrintIndex(SHOW_VERSION, version);
415416

416417
readResponse(SYS_TABLE, SYS_TABLE, SYS_GET_HWEUI, buffer, sizeof(buffer));
417418
sendMacSet(MAC_DEVEUI, buffer);
@@ -652,6 +653,7 @@ void TheThingsNetwork::configureUS915(uint8_t sf, uint8_t fsb)
652653

653654
void TheThingsNetwork::configureAS920_923(uint8_t sf)
654655
{
656+
// TODO: Check if this is necessary and a valid command. RX2 is SF10 at 923.2
655657
sendMacSet(MAC_RX2, "2 923200000");
656658
sendChSet(MAC_CHANNEL_DRRANGE, 1, "0 6");
657659

0 commit comments

Comments
 (0)