mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
629 stars 207 forks source link

Need API to get configured region name/index #32

Closed terrillmoore closed 6 years ago

terrillmoore commented 6 years ago

Now that we can handle so many regions, it makes sense to add two APIs:

  1. LMIC_getConfiguredRegionName() should return the region name as a string: "as923", "us915", etc.
  2. LMIC_getConfiguredRegionIndex() should return the region index. Positive numbers 1..n should match the subsection within section 2 for the LoRaWAN regional spec.

Eventually we should have functions to map from region index to region name and vice versa. But that can wait until we switch to using function tables and allow support for multiple regions with a single codebase.

terrillmoore commented 6 years ago

Decided to add this to https://github.com/mcci-catena/arduino-lorawan instead, as you get all these things from the LMIC config symbols (in scope) anyway, except for the name.