26#define RADIOLIB_LORAWAN_JOIN_EUI 01, 01, 01, 01, 01, 01, 01, 01
29#ifndef RADIOLIB_LORAWAN_DEV_EUI
31#define RADIOLIB_LORAWAN_DEV_EUI 70, B3, D5, 7E, D0, 07, 74, 17
33#ifndef RADIOLIB_LORAWAN_APP_KEY
34#define RADIOLIB_LORAWAN_APP_KEY \
35 2B,7E,15,16,28,AE,D2,A6,AB,F7,15,88,09,CF,4F,3C
37#ifndef RADIOLIB_LORAWAN_NWK_KEY
38#define RADIOLIB_LORAWAN_NWK_KEY \
39 2B,7E,15,16,28,AE,D2,A6,AB,F7,15,88,09,CF,4F,3C
53#define RAW_TO_INT8A(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
54 {0x##a, 0x##b, 0x##c, 0x##d, 0x##e, 0x##f, 0x##g, 0x##h, \
55 0x##i, 0x##j, 0x##k, 0x##l, 0x##m, 0x##n, 0x##o, 0x##p}
57#define RAW8_TO_INT8A(a, b, c, d) 0x##a##b##c##d
58#define RAW32_TO_INT8A(a, b, c, d, e, f, g, h) \
59 {0x##a, 0x##b, 0x##c, 0x##d, 0x##e, 0x##f, 0x##g, 0x##h}
61#define FORMAT_KEY(...) RAW_TO_INT8A(__VA_ARGS__)
62#define FORMAT8_KEY(...) RAW8_TO_INT8A(__VA_ARGS__)
63#define FORMAT32_KEY(...) RAW32_TO_INT8A(__VA_ARGS__)
66static inline uint64_t bytes_to_u64_be(
const uint8_t b[8]) {
67 return ((uint64_t)b[0] << 56) | ((uint64_t)b[1] << 48) |
68 ((uint64_t)b[2] << 40) | ((uint64_t)b[3] << 32) |
69 ((uint64_t)b[4] << 24) | ((uint64_t)b[5] << 16) |
70 ((uint64_t)b[6] << 8) | ((uint64_t)b[7]);
73static inline uint64_t bytes_to_u64_le(
const uint8_t b[8]) {
74 return ((uint64_t)b[7] << 56) | ((uint64_t)b[6] << 48) |
75 ((uint64_t)b[5] << 40) | ((uint64_t)b[4] << 32) |
76 ((uint64_t)b[3] << 24) | ((uint64_t)b[2] << 16) |
77 ((uint64_t)b[1] << 8) | ((uint64_t)b[0]);
80static inline void u64_to_bytes_be(uint64_t value, uint8_t b[8]) {
81 b[0] = (value >> 56) & 0xFF;
82 b[1] = (value >> 48) & 0xFF;
83 b[2] = (value >> 40) & 0xFF;
84 b[3] = (value >> 32) & 0xFF;
85 b[4] = (value >> 24) & 0xFF;
86 b[5] = (value >> 16) & 0xFF;
87 b[6] = (value >> 8) & 0xFF;
91static inline void u64_to_bytes_le(uint64_t value, uint8_t b[8]) {
92 b[7] = (value >> 56) & 0xFF;
93 b[6] = (value >> 48) & 0xFF;
94 b[5] = (value >> 40) & 0xFF;
95 b[4] = (value >> 32) & 0xFF;
96 b[3] = (value >> 24) & 0xFF;
97 b[2] = (value >> 16) & 0xFF;
98 b[1] = (value >> 8) & 0xFF;
const LoRaWANBand_t * Region
const uint32_t uplinkIntervalSeconds