TheThingsNetwork / arduino-device-lib

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

Create Hardware class #163

Closed amkuipers closed 7 years ago

amkuipers commented 7 years ago

As suggested in another issue. Add class with known Serials of devices. e.g. allowing the user to do:

TheThingsNetwork ttn(TTN_DEVICE_SODAQONE, freqPlan);

Using commercial product (version) and/or used chip

johanstokking commented 7 years ago

So the benefit from this is that you don't have to specify your serials.

The downside, also mentioned in the other issue is that we get a non-exhaustive list of devices that we need to maintain, and it all costs flash memory. Also, we need to avoid tricky compiler errors as, for example, Serial1 (for The Things Uno) is not defined when some boards are selected. The board selection is out of scope of the library.

FokkeZB commented 7 years ago

Ah, indeed... it would fail to compile with references to non-existent SerialX. Closing