@@ -30,20 +30,20 @@ class cEventQueue;
30
30
// collisions with a registered app on TTN.
31
31
//
32
32
33
- // This EUI must be in little-endian format, so least-significant-byte
34
- // first. This corresponds to 0x0000000000000001
35
- // static const u1_t PROGMEM APPEUI[8]= { 1 , 0, 0, 0, 0, 0, 0, 0 };
36
- void os_getArtEui (u1_t * buf) { memset (buf, 0 , 8 ); buf[ 0 ] = 1 ; }
33
+ // AppEUI: must be in little-endian format, so least-significant-byte
34
+ // first. This corresponds to 0x0000000000000000
35
+ static const u1_t PROGMEM APPEUI[8]= { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
36
+ void os_getArtEui (u1_t * buf) { memcpy_P (buf, APPEUI , 8 ); }
37
37
38
- // This should also be in little endian format, see above.
38
+ // DevEUI: This should also be in little endian format, see above.
39
39
// This corresponds to 0x0000000000000001
40
- // static const u1_t PROGMEM DEVEUI[8]= { 1, 0, 0, 0, 0, 0, 0, 0 };
41
- void os_getDevEui (u1_t * buf) { memset (buf, 0 , 8 ); buf[ 0 ] = 1 ; }
40
+ static const u1_t PROGMEM DEVEUI[8 ]= { 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
41
+ void os_getDevEui (u1_t * buf) { memcpy_P (buf, DEVEUI , 8 ); }
42
42
43
43
// This key should be in big endian format (or, since it is not really a
44
44
// number but a block of memory, endianness does not really apply).
45
- // static const u1_t PROGMEM APPKEY[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 };
46
- void os_getDevKey (u1_t * buf) { memset (buf, 0 , 16 ); buf[ 15 ] = 2 ; }
45
+ static const u1_t PROGMEM APPKEY[16 ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 };
46
+ void os_getDevKey (u1_t * buf) { memcpy_P (buf, APPKEY , 16 ); }
47
47
48
48
// this data must be kept short -- max is 11 bytes for US DR0
49
49
static uint8_t mydata[] = { 0xCA , 0xFE , 0xF0 , 0x0D };
0 commit comments