Lora Personalized device for Everynet
Dependencies: LMiCPersonalizedforEverynet SX1276Lib X_NUCLEO_IKS01A1 cantcoap lwip mbed-rtos mbed
Fork of LoRaWAN-test-10secs by
Diff: main.cpp
- Revision:
- 9:84a69ca4d35a
- Parent:
- 8:8d9a49aaa323
- Child:
- 10:155dc60fce79
--- a/main.cpp Mon Dec 21 14:19:42 2015 +0000 +++ b/main.cpp Fri Jan 08 09:58:07 2016 +0000 @@ -58,6 +58,7 @@ /*! * Defines the device address when using personalization activation procedure */ +//To be changed when switching from one to another #define LORAWAN_DEV_ADDR ( uint32_t )0x12345678 //#define LORAWAN_DEV_ADDR ( uint32_t )0x12341111 @@ -77,7 +78,7 @@ /*! * LoRaWAN confirmed messages */ -#define LORAWAN_CONFIRMED_MSG_ON 1 +#define LORAWAN_CONFIRMED_MSG_ON 0 /*! * LoRaWAN application port @@ -205,6 +206,7 @@ ////////////////////////////////////////////////// // application router ID (LSBF) +//To be changed when switching from one to another static const uint8_t AppEui[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 @@ -212,13 +214,14 @@ }; // unique device ID (LSBF) +//To be changed when switching from one to another static const u1_t DevEui[8] = { // 0x00, 0x00, 0x00, 0x00, 0x08, 0x06, 0x02, 0x48 - 0x30, 0x74, 0x73, 0x65, 0x74, 0x2D, 0x52, 0x4C // 4c522d7465737430 = "LR-test0" + 0x30, 0x74, 0x73, 0x65, 0x74, 0x2D, 0x52, 0x4C // 4c522d7465737430 = "LR-test0" // 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x99, 0xF7 -// 0x32, 0x74, 0x73, 0x65, 0x74, 0x2D, 0x52, 0x4C // 4c522d7465737430 = "LR-test2" +// 0x32, 0x74, 0x73, 0x65, 0x74, 0x2D, 0x52, 0x4C // 4c522d7465737430 = "LR-test2" // 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF @@ -236,6 +239,7 @@ #if( OVER_THE_AIR_ACTIVATION == 0 ) // network session key +//To be changed when switching from one to another static uint8_t NwkSKey[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, @@ -244,6 +248,7 @@ }; // application session key +//To be changed when switching from one to another static uint8_t ArtSKey[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, @@ -349,6 +354,7 @@ static void prepareTxLoraFrame( void ) { const char *frame = "LoRa"; +// const char *frame = "Test"; strncpy((char*) LMIC.frame, frame, strlen(frame)); @@ -360,9 +366,11 @@ LMIC.frame[strlen(frame)+4] = LMIC.snr; #endif debug_str("Frame to be sent: "); - debug_buf(LMIC.frame, strlen(frame) + 5); +// debug_buf(LMIC.frame, strlen(frame) + 5); + debug_buf(LMIC.frame, strlen(frame)); - LoRaWAN_data_size = strlen(frame) + 5; +// LoRaWAN_data_size = strlen(frame) + 5; + LoRaWAN_data_size = strlen(frame); } static void prepareTxFrame( void )