Send text with LoRaWAN.
Dependencies: LMiC SX1276Lib mbed
Fork of LoRaWAN-lmic-app by
Revision 13:d2eb917f9883, committed 2015-11-11
- Comitter:
- tamberg
- Date:
- Wed Nov 11 18:32:46 2015 +0000
- Parent:
- 12:020ffc39a19e
- Commit message:
- Added TTN default keys.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 020ffc39a19e -r d2eb917f9883 main.cpp --- a/main.cpp Wed Oct 21 20:44:53 2015 +0000 +++ b/main.cpp Wed Nov 11 18:32:46 2015 +0000 @@ -5,24 +5,24 @@ #include "debug.h" #define LORAWAN_NET_ID (uint32_t) 0x00000000 -// TODO: enter your device address below, e.g. for DevAddr 01234567 => -#define LORAWAN_DEV_ADDR (uint32_t) 0x01234567 // the 0x.. is important +// TODO: enter device address below, for TTN just set ??? +#define LORAWAN_DEV_ADDR (uint32_t) 0x5A480??? #define LORAWAN_ADR_ON 1 #define LORAWAN_CONFIRMED_MSG_ON 1 -#define LORAWAN_APP_PORT 3 +#define LORAWAN_APP_PORT 3//15 static uint8_t NwkSKey[] = { - // TODO: enter your NwkSKey below, - // e.g. for 00112233445566778899AABBCCDDEEFF => - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF + // TODO: enter network, or use TTN default + // e.g. for 2B7E151628AED2A6ABF7158809CF4F3C => + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; static uint8_t ArtSKey[] = { - // TODO: enter your AppSKey below, - // e.g. for 00112233445566778899AABBCCDDEEFF => - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF + // TODO: enter application key, or use TTN default + // e.g. for 2B7E151628AED2A6ABF7158809CF4F3C => + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; osjob_t initjob; @@ -52,7 +52,7 @@ } void onEvent (ev_t ev) { // called by lmic.cpp, see also oslmic.h - debug_event(ev); // log incoming event, e.g. TXCOMPLETE + debug_event(ev); if (ev == EV_TXCOMPLETE) { os_setCallback(&sendFrameJob, onSendFrame); }