Testing basic mdot with external Interrupt
Dependencies: libmDot mbed-rtos mbed-src
Fork of mDot_test_rx by
LoRaWAN Network Configuration
For DevEUI, AppEUI, AppKey configuration to specific network, please see lines 10 to 18.
If using with an 8 channel gateway define config_frequency_sub_band at line 16. Setting config_frequency_sub_band to '1' will limit the device to using just the first eight (8) channels starting at 902.3 MHz.
Free Running vs Interrupt
At line 117 you can change the program from waiting for external interrupts to free-running by changing msg_rdy to be equal to 'true'.
Diff: main.cpp
- Revision:
- 4:ee6bf074135c
- Parent:
- 3:7cc5dfd22b54
- Child:
- 5:25114cb5e9a7
--- a/main.cpp Thu Jul 30 19:02:09 2015 +0000 +++ b/main.cpp Sat Aug 01 01:08:16 2015 +0000 @@ -7,16 +7,18 @@ using namespace mts; +/* ********************************************** */ +/* Create AppEUI identifier and Assigned AppKey */ +/* ********************************************** */ + static const uint8_t DEVKEY[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; // Normal -static const uint8_t APPEUI[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // SMTC AppEUI - -//static const uint8_t DEVKEY[16] = { 0x03, 0x24, 0x22, 0x60, 0xA6, 0xC6, 0x98, 0x5F, 0xD5, 0x02, 0x23, 0xD0, 0x53, 0x00, 0x49, 0xF6 }; // Normal -//static const uint8_t APPEUI[8] = { 0x00, 0x25, 0x0C, 0x00, 0x00, 0x01, 0x00, 0x01 }; // Senet AppEUI -//static const uint8_t APPEUI[8] = { 0x01, 0x00, 0x01, 0x00, 0x00, 0x0C, 0x25, 0x00 }; // Senet AppEUI Swapped +static const uint8_t APPEUI[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // SMTC AppEUI - Most Significant Byte First +static uint8_t config_frequency_sub_band = 0; // 0 = Enable all channels, 1 = 1st eight channels + +/* ********************************************** */ static std::vector<uint8_t> AppKey (DEVKEY, DEVKEY + sizeof(DEVKEY)/sizeof(uint8_t) ); static std::vector<uint8_t> AppEUI (APPEUI, APPEUI + sizeof(APPEUI)/sizeof(uint8_t) ); -static uint8_t config_frequency_sub_band = 0; // 0 = Enable all channels, 1 = 1st eight channels InterruptIn button(PB_1); DigitalOut drive_high(PB_0); @@ -112,7 +114,7 @@ } recv_data.clear(); } - msg_rdy = false; + msg_rdy = false; // Set to 'true' for free running. while (!msg_rdy) wait(wait_time); } END: