TheThingsNetwork / arduino-device-lib

Arduino Library for TTN Devices
MIT License
208 stars 96 forks source link

Introduce join provisioning #50

Closed johanstokking closed 8 years ago

johanstokking commented 8 years ago

When provisioning the device during runtime (e.g. through serial, WiFi or Bluetooth), we need to be able to set the AppEUI and AppKey, without having to join, or let it reset before join.

Proposed API:

bool provision(const byte appEui[8], const byte appKey[16]);

This method does a mac set appeui, mac set deveui and mac save, see command reference.

Then, you can call just join() in setup() or loop(), that uses the AppEUI and AppKey from memory, and thus only takes retries, as in #39

FokkeZB commented 8 years ago

As part of this change bool join(const byte appEui[8], const byte appKey[16]) should first call provision(const byte appEui[8], const byte appKey[16]) and then bool join()

FokkeZB commented 8 years ago

Closed by #59