@@ -22,28 +22,28 @@ Author:
22
22
#include < SPI.h>
23
23
class cEventQueue ;
24
24
25
- #define APPLICATION_VERSION ARDUINO_LMIC_VERSION_CALC (3 , 0 , 99 , 10 )
25
+ #define APPLICATION_VERSION ARDUINO_LMIC_VERSION_CALC (4 , 0 , 0 , 0 )
26
26
27
27
//
28
28
// For compliance tests with the RWC5020A, we use the default addresses
29
29
// from the tester; except that we use APPKEY 0,..., 0, 2, to avoid
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 };
@@ -765,16 +765,22 @@ void setup_printSignOn()
765
765
printVersion (ARDUINO_LMIC_VERSION);
766
766
Serial.print (F (" configured for region " ));
767
767
Serial.print (CFG_region);
768
+
769
+ #if defined(ARDUINO_LMIC_CFG_SUBBAND) && ARDUINO_LMIC_CFG_SUBBAND != -1
770
+ Serial.print (F (" subband[0:7] " ));
771
+ Serial.print (unsigned (ARDUINO_LMIC_CFG_SUBBAND));
772
+ #endif // defined(ARDUINO_LMIC_CFG_SUBBAND) && ARDUINO_LMIC_CFG_SUBBAND != -1
773
+
768
774
Serial.println (F (" .\n Remember to select 'Line Ending: Newline' at the bottom of the monitor window." ));
769
775
770
776
setup_printSignOnDashLine ();
771
777
printNl ();
772
778
}
773
779
774
780
void setupForNetwork (bool preJoin) {
775
- #if CFG_LMIC_US_like
776
- LMIC_selectSubBand (0 );
777
- #endif
781
+ #if defined(ARDUINO_LMIC_CFG_SUBBAND) && ARDUINO_LMIC_CFG_SUBBAND != -1
782
+ LMIC_selectSubBand (ARDUINO_LMIC_CFG_SUBBAND );
783
+ #endif // defined(ARDUINO_LMIC_CFG_SUBBAND) && ARDUINO_LMIC_CFG_SUBBAND != -1
778
784
}
779
785
780
786
void loop () {
0 commit comments