From 0dc3f1cf4f9ee0a65d33bfb25014c0bad72d71bf Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 19 Sep 2018 19:34:02 +0200 Subject: [PATCH] lorawan.cpp: prepared bugfix in DEVEUI generator --- src/lorawan.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 0ee8b6c0..03cfeca8 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -37,6 +37,23 @@ void gen_lora_deveui(uint8_t *pdeveui) { } } +/* The above function should be changed to this one, but this would be a breaking change + +// DevEUI generator using devices's MAC address +void gen_lora_deveui(uint8_t *pdeveui) { + uint8_t *p = pdeveui, dmac[6]; + ESP_ERROR_CHECK(esp_efuse_mac_get_default(dmac)); + *p++ = dmac[0]; + *p++ = dmac[1]; + *p++ = dmac[2]; + *p++ = 0xff; + *p++ = 0xfe; + *p++ = dmac[3]; + *p++ = dmac[4]; + *p++ = dmac[5]; +} +*/ + // Function to do a byte swap in a byte array void RevBytes(unsigned char *b, size_t c) { u1_t i;