pzheng 20151201

Dependencies:   LoRaMacLib SX1276Lib mbed Chainable_RGB_LED DigitDisplay

Fork of LoRaWAN by LoRa All

Revision:
17:60af095c8763
Parent:
16:92dcf89f8c7a
Child:
18:0ffbe03c5542
--- a/main.cpp	Wed Dec 02 08:52:38 2015 +0000
+++ b/main.cpp	Wed Dec 02 09:46:52 2015 +0000
@@ -44,7 +44,7 @@
  */
 static uint8_t AppEui[] =
 {
-    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 /*!
@@ -65,25 +65,10 @@
 /*!
  * AES encryption/decryption cipher network session key
  */
-/*static uint8_t NwkSKey[] = 
+static uint8_t NwkSKey[] = 
 { 
     0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
     0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
-};*/
-
-/*!
- * AES encryption/decryption cipher application session key
- */
-/*static uint8_t AppSKey[] = 
-{ 
-    0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
-    0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
-};*/
-
-static uint8_t NwkSKey[] = 
-{ 
-    0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
-    0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
 };
 
 /*!
@@ -91,9 +76,24 @@
  */
 static uint8_t AppSKey[] = 
 { 
-    0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
-    0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
+    0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
+    0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
 };
+
+//static uint8_t NwkSKey[] = 
+//{ 
+//    0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
+//    0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
+//};
+
+///*!
+// * AES encryption/decryption cipher application session key
+// */
+//static uint8_t AppSKey[] = 
+//{ 
+//    0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
+//    0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
+//};
 #endif
 
 
@@ -361,7 +361,8 @@
         DevAddr = randr( 0, 0x01FFFFFF );
     }
     debug( "- DevAddr = 0x%x\n\r" , DevAddr);    
-    LoRaMacInitNwkIds( 0x000000, DevAddr, NwkSKey, AppSKey );
+    LoRaMacInitNwkIds( 0x000000, DevAddr, NwkSKey, AppSKey );  
+    
     for(int i = 0; i<16; i++)
     {
         debug( "- NwkSKey[%d] = 0x%x\n\r" , i, NwkSKey[i]);