Lab exercise code for FAE Summit 09/2019.

Files at this revision

API Documentation at this revision

Comitter:
lru
Date:
Wed Sep 18 18:52:39 2019 +0000
Parent:
58:cf54c181a632
Commit message:
Fixed lorawan configuration.; Removed leftover DummySensor file.

Changed in this revision

DummySensor.h Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
diff -r cf54c181a632 -r 4628ef4b0d52 DummySensor.h
--- a/DummySensor.h	Wed Sep 18 17:40:11 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2017, Arm Limited and affiliates.
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef MBED_LORAWAN_DUMMYSENSOR_H_
-#define MBED_LORAWAN_DUMMYSENSOR_H_
-
-/*
- * A dummy sensor for Mbed LoRa Test Application
- */
-class DS1820 {
-public:
-    DS1820(uint32_t)
-    {
-        value = 1;
-    };
-    bool begin()
-    {
-        return true;
-    };
-    void startConversion() {};
-    int32_t read()
-    {
-        value += 2;
-        return value;
-    }
-
-private:
-    int32_t value;
-};
-
-
-
-#endif /* MBED_LORAWAN_DUMMYSENSOR_H_ */
diff -r cf54c181a632 -r 4628ef4b0d52 main.cpp
--- a/main.cpp	Wed Sep 18 17:40:11 2019 +0000
+++ b/main.cpp	Wed Sep 18 18:52:39 2019 +0000
@@ -23,10 +23,8 @@
 #include "mbed.h"
 
 // Application helpers
-#include "DummySensor.h"
 #include "trace_helper.h"
 #include "lora_radio_helper.h"
-
 #include "neo_iso_drv.h"
 
 
@@ -105,8 +103,8 @@
 
 neoiso::NeoIso ssr(I2C_SCL, I2C_SDA, 0);
 
-//static const uint8_t target_device_eui[] = MBED_CONF_APP_TARGET_DEVICE_EUI;
-static const uint8_t target_device_eui[] = { 0x00, 0xa0, 0x50, 0xff, 0xfe, 0x81, 0x27, 0x95 };
+static const uint8_t target_device_eui[] = MBED_CONF_APP_TARGET_DEVICE_EUI;
+//static const uint8_t target_device_eui[] = { 0x00, 0xa0, 0x50, 0xff, 0xfe, 0x81, 0x27, 0x95 };
 
 /**
  * Entry point for application
diff -r cf54c181a632 -r 4628ef4b0d52 mbed_app.json
--- a/mbed_app.json	Wed Sep 18 17:40:11 2019 +0000
+++ b/mbed_app.json	Wed Sep 18 18:52:39 2019 +0000
@@ -5,6 +5,7 @@
             "value": "SX1276"
         },
         "main_stack_size":     { "value": 4096 },
+        "target-device-eui": "{ 0x00, 0xa0, 0x50, 0xff, 0xfe, 0x81, 0x2b, 0x58 }",
 
         "lora-spi-mosi":       { "value": "NC" },
         "lora-spi-miso":       { "value": "NC" },
@@ -32,10 +33,12 @@
             "platform.default-serial-baud-rate": 115200,
             "lora.over-the-air-activation": true,
             "lora.duty-cycle-on": true,
+            "lora.automatic-uplink-message": true,
             "lora.phy": "EU868",
+            "lora.app-port": 2,
             "lora.device-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
             "lora.application-eui": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
-            "lora.application-key": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }"
+            "lora.application-key": "{ 0x47, 0x20, 0x68, 0xea, 0xf7, 0xd4, 0xa4, 0x3e, 0xbf, 0x13, 0xc9, 0xb2, 0xdf, 0x98, 0x91, 0x61 }"
         },
 
         "K64F": {
@@ -258,6 +261,28 @@
             "lora-ant-switch":     "NC",
             "lora-pwr-amp-ctl":    "NC",
             "lora-tcxo":           "NC"
+        },
+
+        "FUTURE_SEQUANA": {
+            "lora-radio":          "SX1272",
+            "lora-spi-mosi":       "SPI_MOSI",
+            "lora-spi-miso":       "SPI_MISO",
+            "lora-spi-sclk":       "SPI_CLK",
+            "lora-cs":             "D10",
+            "lora-reset":          "A0",
+            "lora-dio0":           "D2",
+            "lora-dio1":           "D3",
+            "lora-dio2":           "D4",
+            "lora-dio3":           "D5",
+            "lora-dio4":           "D8",
+            "lora-dio5":           "D9",
+            "lora-rf-switch-ctl1": "NC",
+            "lora-rf-switch-ctl2": "NC",
+            "lora-txctl":          "NC",
+            "lora-rxctl":          "NC",
+            "lora-ant-switch":     "NC",
+            "lora-pwr-amp-ctl":    "NC",
+            "lora-tcxo":           "NC"
         }
     },
     "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_lora_config.h\""]