Closed n2jn closed 8 years ago
@johanstokking can't we just call reset()
unless personalize()
was called with no arguments? Or am I not understanding the reason for reset()
?
Yep. I think if you want to personalize with custom keys, that it's good to reset first. Otherwise, when you want to personalize with whatever is in the RN module, you don't reset first.
Should I put reset() in the private section, now that we only use it in personalize() and join() ?#39
@Nicolasdejean no it's OK like this
Code is approved
@FokkeZB can you test?
I've successfully tested with this in setup()
ttn.init(loraSerial, debugSerial);
debugPrintLn("Personalize with keys");
ttn.personalize(devAddr, nwkSKey, appSKey);
debugPrintLn("Send 0x11");
byte payload[] = { 0x11 };
ttn.sendBytes(payload, sizeof(payload));
debugPrintLn("Personalize without keys");
ttn.personalize();
debugPrintLn("Send 0x22");
byte payload2[] = { 0x22 };
ttn.sendBytes(payload2, sizeof(payload2));
Both messages came through fine.
Added a bool in parameter: true does a reset, false doesn't.#6