hello world
Dependencies: lib_gps lib_mpl3115a2 lmic_MOTE_L152RC mbed
Fork of lmic_NAmote_GPS by
Diff: main.cpp
- Revision:
- 4:f9aaf0f82c00
- Parent:
- 3:d81e4a63fb2e
- Child:
- 6:0b2b2d196ddd
--- a/main.cpp Fri Jul 17 21:11:02 2015 +0000 +++ b/main.cpp Sat Jul 18 00:21:10 2015 +0000 @@ -19,8 +19,8 @@ #include "debug.h" -#define SENET_F -//#define SMTC +//#define SENET_F +#define SMTC typedef enum { MOTE_NONE = 0, @@ -40,9 +40,9 @@ // DevEUI and Keys defined by Activation type // #define APP_DATA_SIZE 11 #define APP_ACK 0 -#define DELAY_NEXT_TX 10 +#define MS_DELAY_NEXT_TX 400 #ifdef SMTC -#define OVER_THE_AIR_ACTIVATION 0 +#define OVER_THE_AIR_ACTIVATION 1 //0 #else #define OVER_THE_AIR_ACTIVATION 1 #endif /* SMTC */ @@ -82,15 +82,17 @@ #ifdef SMTC // Semtech Activation (v1.x server) // application router ID (LSBF) -static const u1_t APPEUI[8] = { 0xAA, 0xCC, 0x11, 0x00, 0xCC, 0xEE, 0x77, 0xEE }; +static const u1_t APPEUI[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // unique device ID (LSBF) -static const u1_t DEVEUI[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }; +//static const u1_t DEVEUI[8] = { 0x20, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x25, 0x00 }; +static const u1_t DEVEUI[8] = { 0x34, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x25, 0x00 }; +//static const u1_t DEVEUI[8] = { 0x35, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x25, 0x00 }; // device-specific AES key (derived from device EUI) -static const u1_t DEVKEY[16] = { 0xAB, 0x89, 0xEF, 0xCD, 0x23, 0x01, 0x67, 0x45, 0x54, 0x76, 0x10, 0x32, 0xDC, 0xFE, 0x98, 0xBA }; +static const u1_t DEVKEY[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; -static uint8_t NwkSKey[] = +/*static uint8_t NwkSKey[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C @@ -100,7 +102,7 @@ { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C -}; +};*/ #endif /* SMTC */ @@ -267,6 +269,9 @@ else LMIC.txpow_limit = 30; #endif /* !CHNL_HYBRID */ + + // test forcing: + LMIC.datarate = DR_SF10; // force SF10 } @@ -306,7 +311,7 @@ os_setTimedCallback( &rxLedJob, os_getTime() + ms2osticks(15), onRxLed ); } tx: - os_setTimedCallback( &sendFrameJob, os_getTime() + sec2osticks(DELAY_NEXT_TX), onSendFrame ); // Change the Tx periodicity + os_setTimedCallback( &sendFrameJob, os_getTime() + ms2osticks(MS_DELAY_NEXT_TX), onSendFrame ); // Change the Tx periodicity //onSendFrame(NULL); // Blink Tx LED