added other files
Dependencies: lib_gps lib_mpl3115a2 lmic_MOTE_L152RC mbed
Fork of lmic_NAmote_GPS_tjm by
Diff: main.cpp
- Revision:
- 9:f4d52e9625f7
- Parent:
- 8:1069ed1d4464
--- a/main.cpp Tue Feb 09 00:39:29 2016 +0000 +++ b/main.cpp Thu Feb 18 01:32:16 2016 +0000 @@ -18,7 +18,8 @@ #include "gps.h" #include "debug.h" -#define SENET_F +#define LORA_IT +//#define SENET_F //#define SMTC typedef enum { @@ -66,6 +67,20 @@ ////////////////////////////////////////////////// // CONFIGURATION (FOR APPLICATION CALLBACKS BELOW) ////////////////////////////////////////////////// +#ifdef LORA_IT +// application router ID (LSBF) +//static const u1_t APPEUI[8] = { 0x01, 0x00, 0x01, 0x00, 0x00, 0x0c, 0x25, 0x00 }; +static const u1_t reverse_APPEUI[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; + +// unique device ID (LSBF) +//static const u1_t DEVEUI[8] = { 0x0f, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x25, 0x00 }; +static const u1_t reverse_DEVEUI[8] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0xee, 0xff, 0xc0 }; + +// device-specific AES key (derived from device EUI) +static const u1_t DEVKEY[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, }; + // E4 -72 -71 -C5 -F5 -30 -A9 -9F -CF -C4 -0E -AB -EA -D7 -19 -42 +#endif /* LORA_IT */ + #ifdef SENET_F // application router ID (LSBF) //static const u1_t APPEUI[8] = { 0x01, 0x00, 0x01, 0x00, 0x00, 0x0c, 0x25, 0x00 }; @@ -170,7 +185,7 @@ // } } -#if 0 +#if 1 // initial job static void initfunc (osjob_t* j) { debug_str("B: INITFUNC\n"); @@ -201,7 +216,7 @@ } #endif -#if 1 +#if 0 // counter static int cnt = 0; // log text to USART and toggle LED @@ -359,6 +374,7 @@ os_setTimedCallback( &txLedJob, os_getTime() + ms2osticks(25), onTxLed ); break; default: + debug("event: %d/n",ev); break; } }