Final version of the exercise on the Things Network
Dependencies: X_NUCLEO_IKS01A2
Revision 3:8c7198d1a2a1, committed 2018-03-11
- Comitter:
- mbed_official
- Date:
- Sun Mar 11 09:45:20 2018 +0000
- Parent:
- 2:dc95ac6d6d4e
- Child:
- 4:df442e6af8cf
- Commit message:
- Added LORAWAN_ENABLED flag to disable building in unsupported devices
- Also added check for SPI as it is needed by Radio technoology
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-lorawan
Changed in this revision
--- a/lora_radio_helper.h Fri Mar 09 13:15:17 2018 +0000
+++ b/lora_radio_helper.h Sun Mar 11 09:45:20 2018 +0000
@@ -20,6 +20,10 @@
#ifndef APP_LORA_RADIO_HELPER_H_
#define APP_LORA_RADIO_HELPER_H_
+#if MBED_CONF_APP_LORAWAN_ENABLED
+
+#ifdef DEVICE_SPI
+
#include "SX1272_LoRaRadio.h"
#include "SX1276_LoRaRadio.h"
@@ -72,4 +76,8 @@
#error "Unknown LoRa radio specified (SX1272,SX1276 are valid)"
#endif
+#endif //DEVICE_SPI
+
+#endif //MBED_CONF_APP_LORAWAN_ENABLED
+
#endif /* APP_LORA_RADIO_HELPER_H_ */
--- a/main.cpp Fri Mar 09 13:15:17 2018 +0000
+++ b/main.cpp Sun Mar 11 09:45:20 2018 +0000
@@ -15,6 +15,11 @@
* limitations under the License.
*/
#include <stdio.h>
+
+#if MBED_CONF_APP_LORAWAN_ENABLED
+
+#ifdef DEVICE_SPI
+
#include "lorawan/LoRaWANInterface.h"
#include "lorawan/system/lorawan_data_structures.h"
#include "events/EventQueue.h"
@@ -137,8 +142,11 @@
// make your event queue dispatching events forever
ev_queue.dispatch_forever();
+
+ return 0;
}
+
/**
* Sends a message to the Network Server
*/
@@ -251,4 +259,12 @@
}
}
+#endif //DEVICE_SPI
+
+#else
+int main (void)
+{
+ return 0;
+}
+#endif //MBED_CONF_APP_LORAWAN_ENABLED
// EOF
--- a/mbed-os.lib Fri Mar 09 13:15:17 2018 +0000 +++ b/mbed-os.lib Sun Mar 11 09:45:20 2018 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os#24a3acd647de16ecb79b299c66f550881ee66b7f +git@github.com:AnttiKauppila/mbed-os.git
--- a/mbed_app.json Fri Mar 09 13:15:17 2018 +0000
+++ b/mbed_app.json Sun Mar 11 09:45:20 2018 +0000
@@ -5,6 +5,8 @@
"value": "SX1276"
},
+ "lorawan-enabled": { "value": false},
+
"lora-spi-mosi": { "value": "NC" },
"lora-spi-miso": { "value": "NC" },
"lora-spi-sclk": { "value": "NC" },
@@ -37,6 +39,8 @@
},
"K64F": {
+ "lorawan-enabled": true,
+
"lora-spi-mosi": "D11",
"lora-spi-miso": "D12",
"lora-spi-sclk": "D13",
@@ -58,6 +62,8 @@
},
"DISCO_L072CZ_LRWAN1": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1276",
"lora-spi-mosi": "PA_7",
"lora-spi-miso": "PA_6",
@@ -80,6 +86,8 @@
},
"MTB_MURATA_ABZ": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1276",
"lora-spi-mosi": "PA_7",
"lora-spi-miso": "PA_6",
@@ -102,6 +110,8 @@
},
"XDOT_L151CC": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1272",
"lora-spi-mosi": "LORA_MOSI",
"lora-spi-miso": "LORA_MISO",
@@ -124,6 +134,8 @@
},
"MTB_MTS_XDOT": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1272",
"lora-spi-mosi": "LORA_MOSI",
"lora-spi-miso": "LORA_MISO",
@@ -146,6 +158,8 @@
},
"LTEK_FF1705": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1272",
"lora-spi-mosi": "LORA_MOSI",
"lora-spi-miso": "LORA_MISO",
@@ -168,6 +182,8 @@
},
"MTS_MDOT_F411RE": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1272",
"lora-spi-mosi": "LORA_MOSI",
"lora-spi-miso": "LORA_MISO",
@@ -190,6 +206,8 @@
},
"MTB_ADV_WISE_1510": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1276",
"lora-spi-mosi": "SPI_RF_MOSI",
"lora-spi-miso": "SPI_RF_MISO",
@@ -212,6 +230,8 @@
},
"MTB_RAK811": {
+ "lorawan-enabled": true,
+
"lora-radio": "SX1276",
"lora-spi-mosi": "SPI_RF_MOSI",
"lora-spi-miso": "SPI_RF_MISO",