pzheng 20151201
Dependencies: LoRaMacLib SX1276Lib mbed Chainable_RGB_LED DigitDisplay
Fork of LoRaWAN by
Revision 19:9ae3b9b57ae0, committed 2016-04-19
- Comitter:
- pzheng
- Date:
- Tue Apr 19 00:07:31 2016 +0000
- Parent:
- 18:0ffbe03c5542
- Commit message:
- print all the keys in the format of string
Changed in this revision
LoRaMacLib.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0ffbe03c5542 -r 9ae3b9b57ae0 LoRaMacLib.lib --- a/LoRaMacLib.lib Thu Dec 03 09:03:59 2015 +0000 +++ b/LoRaMacLib.lib Tue Apr 19 00:07:31 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/pzheng/code/LoRaMacLib/#66e623be7f8a +https://developer.mbed.org/users/pzheng/code/LoRaMacLib/#29686c1ac910
diff -r 0ffbe03c5542 -r 9ae3b9b57ae0 main.cpp --- a/main.cpp Thu Dec 03 09:03:59 2015 +0000 +++ b/main.cpp Tue Apr 19 00:07:31 2016 +0000 @@ -44,7 +44,7 @@ */ static uint8_t AppEui[] = { - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*! @@ -356,16 +356,27 @@ debug("Generate random DevAddr\n\r"); DevAddr = randr( 0, 0x01FFFFFF ); } - debug( "- DevAddr = 0x%x\n\r" , DevAddr); + debug( "- DevAddr = 0x%08x\n\r" , DevAddr); LoRaMacInitNwkIds( 0x000000, DevAddr, NwkSKey, AppSKey ); + debug( "- NwkSKey = 0x" ); for(int i = 0; i<16; i++) { - debug( "- NwkSKey[%d] = 0x%x\n\r" , i, NwkSKey[i]); + debug( "%02x" , NwkSKey[i]); + if(i == 15) + { + debug("\n\r"); + } } + + debug( "- AppSKey = 0x" ); for(int i = 0; i<16; i++) { - debug( "- AppSKey[%d] = 0x%x\n\r" , i, AppSKey[i]); + debug( "%02x" , AppSKey[i]); + if(i == 15) + { + debug("\n\r"); + } } IsNetworkJoined = true; #endif @@ -389,18 +400,36 @@ TxNextPacket = false; //Added by pzheng 20151111 - for(int i = 0; i<8; i++) + debug( "- DevEui = 0x" ); + for(int i = 7; i>=0; i--) { //DevEui[i] = 0x10; - debug( "- DevEui[%d] = 0x%x\n\r" , i, DevEui[i]); + debug( "%02x", DevEui[i]); + if(i == 0) + { + debug("\n\r"); + } } - for(int i = 0; i<8; i++) + + + debug( "- AppEui = 0x" ); + for(int i = 7; i>=0; i--) { - debug( "- AppEui[%d] = 0x%x\n\r" , i, AppEui[i]); + debug( "%02x", AppEui[i]); + if(i == 0) + { + debug("\n\r"); + } } + + debug( "- AppKey = 0x" ); for(int i = 0; i<16; i++) { - debug( "- AppKey[%d] = 0x%x\n\r" , i, AppKey[i]); + debug( "%02x" , AppKey[i]); + if(i == 15) + { + debug("\n\r"); + } } sendFrameStatus = LoRaMacJoinReq( DevEui, AppEui, AppKey ); debug("Req Sent\n\r"); @@ -425,10 +454,67 @@ if( TxDone == true ) { - for(int i = 0; i<8; i++) - { - debug( "- DevEui[%d] = 0x%x\n\r" , i, DevEui[i]); - } + //Added by pzheng 20160418 +#if( OVER_THE_AIR_ACTIVATION == 0 ) + + debug( "- DevAddr = 0x%08x\n\r" , DevAddr); + + debug( "- NwkSKey = 0x" ); + for(int i = 0; i<16; i++) + { + debug( "%02x" , NwkSKey[i]); + if(i == 15) + { + debug("\n\r"); + } + } + + debug( "- AppSKey = 0x" ); + for(int i = 0; i<16; i++) + { + debug( "%02x" , AppSKey[i]); + if(i == 15) + { + debug("\n\r"); + } + } + + debug( "- DevEui = 0x" ); + debug( "00000000" ); + debug( "%08x\n\r" , DevAddr ); +#else + + debug( "- DevEui = 0x" ); + for(int i = 7; i>=0; i--) + { + //DevEui[i] = 0x10; + debug( "%02x", DevEui[i]); + if(i == 0) + { + debug("\n\r"); + } + } + + debug( "- AppEui = 0x" ); + for(int i = 7; i>=0; i--) + { + debug( "%02x", AppEui[i]); + if(i == 0) + { + debug("\n\r"); + } + } + + debug( "- AppKey = 0x" ); + for(int i = 0; i<16; i++) + { + debug( "%02x" , AppKey[i]); + if(i == 15) + { + debug("\n\r"); + } + } +#endif TxDone = false; debug( "TxDone \n\n\r" );