mcci-catena / arduino-lorawan

User-friendly library for using arduino-lmic with The Things Network and other LoRaWAN® networks
MIT License
288 stars 54 forks source link

Bug in Arduino_LoRaWAN.h - kCountryCode() #200

Open matthias-bs opened 2 years ago

matthias-bs commented 2 years ago
        // return the country code
        constexpr uint16_t kCountryCode(char c1, char c2)
                {
                return (c1 < 'A' || c1 > 'Z' || c2 < 'A' || c2 > 'Z')
                        ? 0
                        : ((c1 << 8) | c1);
                }

The last part of the return value should probably read

((c1 << 8) | c2)